« first day (1620 days earlier)      last day (3310 days later) » 

2:01 PM
sorry guys for asking here... but by wandering through s.o. it seems i've made everything correct but i still get the same error ...when you want to declare a function template whose template's arguments are the same of function's inputs classes... e.g.

template < class T > void PopulateGrid(const std::vector< T >& tVector,
boost::numeric::ublas::matrix< T >& tMatrix,
char by = 'rand');

is this declared properly? i would like to have a function which works on every classes that can be contained in tVector and tMatrix... :( according to this ---> http://stackoverflow.com/questions/19094340
 
user1804599
No, it's declared improperly.
 
:(
 
user1804599
Function templates can only be declared properly in monospace font.
 
i do
 
Missed that.
I'll link you to an old answer. Let me find it.
 
2:04 PM
thx
 
@LisaAnn Sounds like you're running into this:
453
Q: Why can templates only be implemented in the header file?

MainIDQuote from The C++ standard library: a tutorial and handbook: The only portable way of using templates at the moment is to implement them in header files by using inline functions. Why is this? (Clarification: header files are not the only portable solution. But they are the most convenien...

 
@райтфолд lol
 
@LightnessRacesinOrbit It works with Visual studio.
 
gonna read, th you
 
2:06 PM
@R.MartinhoFernandes About the only thing that does, no doubt.
@райтфолд heh
 
@LightnessRacesinOrbit You have to make it into a dependent type methinks
 
1 min ago, by Lightness Races in Orbit
have to do http://coliru.stacked-crooked.com/a/26e2ed15e69a1a40
(yeah)
it's just annoying
cos that M is only ever going to be able to be one thing
and the contract is a bit too complex to be worth documenting
 
@LightnessRacesinOrbit Yes, but you're never allowed to use members before the definition is in scope. It's... C++ as usual.
 
so it basically HAS to be a Mgr
and, not shown in the example, I end up with a circular dependency
@R.MartinhoFernandes I know it's just annoying
 
@LightnessRacesinOrbit More declarations!
 
@R.MartinhoFernandes A Grr is stored by value in Mgr (a few different instantiations, actually) - and shall remain so!
 
I saw this 'gimme teh codes' question and I just knew..
http://stackoverflow.com/questions/29233305/how-can-i-remove-an-inserted-letter-from-a-string
 
@Mgetz wtf
@MartinJames ;p
 
@LightnessRacesinOrbit it's pre-release, also I suspect it's due to an issue with symlinks not UB. But still...
 
@Mgetz Meh, deleting all files. I was hoping for nasal demons:)
 
2:11 PM
@MartinJames I was hoping for that or the Girlfriend's pregnancy
 
@MartinJames Yeah, me too.
 
Try explaining that virgin birth!
 
@Mgetz doesn't look like UB but still lol
 
ASR
Hi I all I have one doubt, can any one clarify me?
 
@ASR only one... wow that is some faith
 
2:13 PM
Consider yourself clarified.
You can go now.
(I'm a pope; I can clarify people)
 
Xeo
1 message moved to bin
 
@ASR please as this on Stack overflow and not in chat
 
ASR
:(
 
user1804599
@Mgetz unreleased update :(
 
ASR
@Mgetz that was in SO already Still I have doubt
 
2:14 PM
@ASR That was a wall of code, not a doubt.
 
@ASR then ask a new question about your doubts
 
IT WAS ALSO C# SO... FUCK OFF?
 
C++03... template friends?
 
@ASR no way. unbelievable. Wait while I call the newreporter
@LightnessRacesinOrbit ur doubt?
 
trying so hard not to address 'doubt'
 
2:17 PM
@R.MartinhoFernandes hmm... as of the s.o. answer you kindly provided me with, in order to avoid having a huuuge header with inlined template function, is Luc Touraille's solution of #include "Foo.tpp" in the middle of header... the best possible?
 
@LisaAnn yes
or ".ipp"
up to you
 
@LisaAnn Yeah, the state of affairs is quite sad.
 
@LightnessRacesinOrbit @R.MartinhoFernandes thank both of you
 
I should learn proper English just to have good names for my objects
 
user1804599
2:20 PM
Just for that?
 
user1804599
My JIT compiler is a template.
 
@LightnessRacesinOrbit template <typename> friend B; or something? Though I think that's C++11-only.
 
@R.MartinhoFernandes indeed
 
2:25 PM
@Mgetz that's a legit new language feature
 
Xeo
@R.MartinhoFernandes C++03
 
@Mgetz Why lol?
 
Xeo
C++11 was friend TemplateParameter;
 
@sehe I could have sworn that template<typename T> as the official syntax since 98?
or am I completely missing something?
 
@Mgetz template<template<typename>typename>
 
2:26 PM
@райтфолд so it is
 
user1804599
:[
 
user1804599
11 jun
 
@R.MartinhoFernandes ouch.... but I can see how that would be useful with nested templates
 
@Mgetz what robot said. Yes, you would have noticed if typename wasn't supported by MSVC there
 
@Mgetz I honestly don't see how it would be useful.
It's horrible.
What.
It prevents nothing.
It's just a syntactic bullshit.
class provides a much more distinctive clue that it's not a normal type parameter.
typename only obfuscates that.
@Mgetz Not at all related.
 
2:28 PM
@Xeo AHA
 
It's only that you can use typename as the keyword where you could only use class.
 
@райтфолд Many things remain relevant. And unanswered:
77
Q: Was this 4th grader's creationist quiz real?

TomOnTimeIs this 4th grader's creationist quiz real or a hoax?

5
 
user1804599
template<template <typename template>>->template typename()
 
user1804599
@sehe lol
 
@Xeo Yep perfect thanks :D
@R.MartinhoFernandes mleh. perhaps. you're arguing that it makes sense because you can't have int templates, right?
 
2:31 PM
4 mins ago, by R. Martinho Fernandes
@Mgetz template<template<typename>typename>
 
@R.MartinhoFernandes yah what about it
 
template<template<typename>class> has a more striking visual cue that it isn't a type parameter (assuming you're not one of those heretics that uses class like @Xeo).
 
Xeo
ehehehehe
 
@R.MartinhoFernandes is it? now it looks like it's a class parameter precisely as much as it used to look like a type parameter
 
Xeo
typename is just too loooong!
 
2:33 PM
except that template <typename T> int x; is not valid
 
@LightnessRacesinOrbit Yes, it is.
 
@Xeo use trait_t
 
WTF
I think you're too obsolete to have this discussion.
 
user1804599
I like typename.
 
Xeo
2:34 PM
1 min ago, by R. Martinho Fernandes
template<template<typename>class> has a more striking visual cue that it isn't a type parameter (assuming you're not one of those heretics that uses class like @Xeo).
In response to that
 
@Xeo ah, right
 
@R.MartinhoFernandes Charming.
 
C++1y doesn't exist yet.
I'm talking about C++, not the sandbox!
:ducks:
 
2:36 PM
anyway, I thought you needed constexpr on that, is why I didn't think it were valid (plus GCC's rejection)
 
user1804599
 
Xeo
lol
 
So what is your argument? If non-class types can be "templated" too. Why is typename obfuscation?
inb4 you can't have template template with non-class
 
user1804599
Clang supports static_assert with no message, but not variadic lambdas. Pfft.
 
user1804599
2:38 PM
OMG Nested namespace definition
 
Xeo
@LightnessRacesinOrbit That's not a non-class type, that's a template variable.
 
ok
ah man I wish I had uniform initialisation
never really had a strong desire for it until right now
 
They should allow struct there, not typename.
 
Xeo
template<class T> using stuff = ...;
 
Or just nought.
 
Xeo
2:39 PM
what should that one use? :P
 
@R.MartinhoFernandes but struct can't have constructors and member functions or polymorphism!
inb4 kick
 
The word after the closing >, whatever it is, is just noise.
 
Oh tits, @ScottW sent me a friend request on Facebook.
 
just as side note ... if you want to std::random_shuffle() a whole boost::numeric::ublas::matrix it seems that mixing iterators .begin1() with .end2() does not go from the (0,0) cell to the (size_t, size_t) cell :P what a pity, my noobish rocks today :D
 
@EtiennedeMartel so?
 
2:40 PM
template<template<typename> T> should be enough.
 
@LisaAnn lol nice try
mixing iterators is basically never a good idea
@R.MartinhoFernandes meh. template <typename T> Foo { /* members */ }; isn't enough
 
@LightnessRacesinOrbit That's that.
 
@EtiennedeMartel ok
 
Xeo
@R.MartinhoFernandes Is that for passing variable templates?
(They're not allowed as template parameters :<)
 
@Xeo That shouldn't exist.
 
ASR
2:49 PM
@R.MartinhoFernandes thanks I got
 
@LightnessRacesinOrbit How are you doing, by the way?
 
@ScarletAmaranth UFO sighted
 
sorry if i go back on that topic, but... would it make any difference implementing a template function via #include "Foo.tpp" (as suggested) as inline? my poor knowledges say that it makes difference, but my implementation is so long that i am quite sure compiler will ignore my inlining
 
it doesn't matter, no. Inline is always a hint. Pretty sure there's a entry for this
 
user1804599
Inline is an ODR tool.
 
2:53 PM
@sehe i know it's a hint for the compiler, but it's the first time i use that kind of #include and was wondering if there was any peculiarity to pay attention to...
 
@EtiennedeMartel great thanks u
 
@sehe urrrmm...?
 
@LisaAnn includes have no effect. Includes just include code verbatim, so it's the same as implementing in the header directly
@ScarletAmaranth I see you were here yesterday as well. Carry on
 
@sehe ok ty i'll inline it
 
@sehe carry on I shall
 
3:03 PM
"You can apply for this job here. Qualified applicants with criminal histories will be considered for the position in a manner consistent with the Fair Chance Ordinance."
interesting
companies usually don't write that in plain sight on an apply page
 
user1804599
> Uppercase and lowercase characters differ by just one bit and the ASCII
character 2 differs from the double quote by just one bit, too. That
made it much easier to encode characters mechanically or with a non-
microcontroller-based electronic keyboard and that pairing was found on
old teletypes.
 
user1804599
Awesome!
 
Xeo
@LisaAnn The usual reason to keep it in an extra file and #include it is for seperation and clarity (which is the interface, which is the implementation, etc)
 
@MarcoA. finally a position you can apply for then!
 
@sehe damn you :|
 
3:13 PM
@xeo got it
 
@sehe I can apply for any position I want. Just some of those applications might be thrown away without a second thought. :-)
 
@JerryCoffin You know.. you can't just tell a criminal applicant "you're not exactly what we're searching for, thanks for applying"
 
@MarcoA. Sure you can. It might not be a very good idea to do that, but you can do it anyway.
 
@JerryCoffin You don't have to send them your criminal record out of your own volition, no?
 
He might illustrate you how to use killall
 
3:18 PM
Except killall from psmisc doens't killall on linux and some UNIXen
 
@sehe No, not that I know of, anyway.
 
This was a nice surprise the day that I troubleshooted a TRU64 machine
@JerryCoffin I never do send mine either
(inb4 my next job application gets refused because they found this in chat and never knew about humor)
 
user1804599
 
@sehe humor? so you didn't rape her?
 
@sehe I actually do have a criminal record. I got a traffic ticket once.
 
3:21 PM
I see, joke-rapes are fine
 
The fines for rape are a joke
 
Fine? I am pretty sure they are sentences
 
It seems my boss likes to name things x_manager :<
When he's back from holiday there will be something to talk about.
@JerryCoffin Is that a crime?
 
@R.MartinhoFernandes Yeah, I think so.
 
@khajvah whoosh; you got raped by a fine joke
 
user1804599
3:25 PM
We have a class AccountManager.
 
user1804599
However, it doesn't manage accounts.
 
I found a indexed_manager.
 
@R.MartinhoFernandes including, say, vases?
 
@R.MartinhoFernandes So do you have a manager_manager?
 
user1804599
It represents somebody who is an account manager. :D
 
3:26 PM
@sehe lol ok
 
I have no fucking idea what this code does.
 
@R.MartinhoFernandes managers need to be indexed too
 
Half of it is because the names are horrible.
 
@R.MartinhoFernandes well, it manages the indexed
 
user1804599
It's a manager which is indexed.
 
3:29 PM
Yeah. It manages. And is indexed.
 
@райтфолд I was about to say: "You shouldn't use "which" to refer to a manager; managers are people too", but then I realized that I wasn't sure that was true (even of the ones that look vaguely human).
 
Xeo
@R.MartinhoFernandes "Boss, your naming sucks, you're fired"
 
@sehe lol
 
@Xeo Just need a check-in and check-out hook to keep x_manager, y_manager and z_manager in the repo where the boss sees them, but lets the developers see decent names instead. :-)
 
> The action is to fast paced! How am I suppose to keep up? Boss fights to hard, not enough free roam all set path. Also side note had to buy a PS4 for this game because the disc fo sho does not work on my Xbox One, believe me I tried everything the Rumors Aaron spread were lies. I do like all the gore though!
 
3:33 PM
39
A: Can you write virtual functions / methods in Java?

duffymoAll functions in Java are virtual by default. You have to go out of your way to write non-virtual functions by adding the "final" keyword. This is the opposite of the C++/C# default. Class functions are non-virtual by default; you make them so by adding the "virtual" modifier.

 
^ Metacritic user review for Bloodborne.
4/10.
 
@EtiennedeMartel meta-Metacricitic review: Metacritic review shows terrible spelling, grammar, punctuation, and usage. 1/100.
 
user1804599
Xehe
 
Is there a quick reference page somewhere on the internet that tells the number of bytes in different data types (char, short etc.)?
 
Xeo
platform-dependent.
 
3:40 PM
Well, talking specifically C++/Windows
 
user1804599
 
@DemCodeLines No but it shouldn't take more than 20 minutes to make your own for your specific environment.
 
FUCK YOU VISUAL STUDIO
 
user1804599
The number of bytes in a short, for example, is sizeof(short).
 
Xeo
@DemCodeLines ... still platform-dependent.
 
3:41 PM
> fatal error C1041: cannot open program database 'd:\dev\mynd\build\release\myndrecorder.pdb'; if multiple CL.EXE write to the same .PDB file, please use /FS
 
@DemCodeLines Still varies (16-, 32-, and 64-bit compilers on Windows, and possibly even differences between sizes with different 64-bit compilers).
 
@Xeo How more dependent do you get?
 
Xeo
What Jerry says
 
tries to delete pdb file
> The action can't be completed because the file is open in Microsoft Visual Studio Express 2013 for Windows Desktop
Visual Studio: How Is This Still A Thing?
 
it's still a thing because nobody has built a better thing
 
3:47 PM
It's easy to know when I'm using Visual Studio: I'm here complaining. Every single time I have to do something with it, it throws some nonsense at me.
 
well, there is CLion!
rawr
 
What do I have to do to debug through a call to std::function without having to F11 through ten levels of internals?
 
enable Just My Code
I think that they enabled it for native too in 2013
 
@Puppy No, that's bullshit.
 
user1804599
@R.MartinhoFernandes grep -v
 
3:52 PM
what in particular is bullshit about it
 
@Puppy If by "enabled" you mean "added a placebo checkbox", yes.
 
offering free textplanations ok
 
@Puppy What about not actually doing that?
I.e. it's enabled (AFAIK it's always been) and I still have to step through all the internals of std::function.
 
I don't recall Just My Code not stepping over stdlib code
 
Xeo
@Puppy That should be a per-step-into option. :/
@R.MartinhoFernandes How they determine what "your" code is, is... interesting.
 
3:55 PM
Is there a feature they advertised that isn't sub-par?
 
user1804599
I want boost::nonmovable.
 
noncopyable does that.
 
user1804599
Wooot.
 
user1804599
Fucking awesome!
 
don't know why, there's hardly any useful types at all that are nomovable
 
Xeo
3:59 PM
@R.MartinhoFernandes Really? What a misleading name!
 
@Xeo It's an accident.
 
> The bottom line is that you the author of class Fred are responsible to make sure self-assignment on a Fred object is innocuous. Do not assume that users won’t ever do that to your objects. It is your fault if your object crashes when it gets a self-assignment.
 
Xeo
@R.MartinhoFernandes Didn't that change, with declaring copy ops == deleting move ops?
 
@Xeo That's the accident.
 
Xeo
I remember a proposal that move ops are never deleted or something. Maybe it's C++14
 
4:00 PM
They're not generated, though.
If you have copy ctor, and no move ctor, it's always the copy ctor that gets used.
 
Xeo
Yeah, and I think that changed with '14
IIRC
 
No.
The direction is to generate nothing when you put one of them.
@Xeo Changing that would be a ridiculous breakage for no justifiable reason.
 
Xeo
Well, Howard Hinnant had some kinda proposal around generation / deletion of special members, and one of the options was to just generate everything all the time (except if sub-objects forbid that special member specifically)
I'd have to read up on it again to be sure, though
Which is too much effort
 
@Xeo That's broken.
It's the behaviour we had before moves, which is now deprecated.
Those members function as a unit, and if you think you're responsible for one, you are responsible for all.
(Pity they didn't realise that with hashes and equivalence)
Now please excuse me while I go step through std::function again.
 
@DonLarynx Self-assignment is a trivial edge case not worth any serious consideration, and secondly, pretty much all all strongly-exception-safe assignment operators get self-assignment safety for free.
 
4:10 PM
@райтфолд ok, originality bonus awarded
@R.MartinhoFernandes If CL.EXE still bothers you, please use /FFS
 
@DemCodeLines Just ask your compiler.
 
@DemCodeLines I'm serious.
 
@Puppy Then why does isocpp.org have an FAQ on it?
 
@R.MartinhoFernandes yeah
 
4:12 PM
std::cout << "int: " << sizeof(int) gives you the answer.
@DonLarynx Ew.
Really?
That sucks.
Though I think we had already established the curation in isocpp.org wasn't that good.
 
@R.MartinhoFernandes I think the compiler itself is okay. (Compare ICC/XlC++ etc.) Some of the debugging/analysis tools are fine (profiler/parallel task visualation). Extensibility is ok (although, don't ask the devs who have to write to these arcane APIs).
Of course, speed is ridiculous, stability abysmal and price unfathomable probably fair
 
@sehe The compiler is not ok. It's full of advertised features that don't really work. (And that's the primary reason I end up using this shit from time to time)
@sehe It's free now.
 
@R.MartinhoFernandes solution: don't read the advertising. (I know you're just having a different weighing, but I must conclude the compiler is usable. Mostly)
@R.MartinhoFernandes Full version?
 
Yes. With only commercial licensing restrictions or something.
 
user1804599
$ git show | xargs banner
 
4:16 PM
Where's that rock. There must be a rock somewhere over my head
 
god damn it
 
user1804599
lol $ git show | xargs banner | xargs banner.
 
android build took me 3 hours because of a faulty cable
 
@R.MartinhoFernandes It's the Marshal Cline C++-FAQ content. They did inquire about a mass hyperlink edit on Meta
 
@R.MartinhoFernandes At least with a decent standard library, you can do a lot better than that. coliru.stacked-crooked.com/a/26df4a73c195055a
Of course, with g++, the results are basically worthless...
 
4:18 PM
@sehe You look at the announcements and changelogs and whatnot and decide "within the range of compilers we have, we can use this set of C++11 features, let's get cracking", and then FUCK ALL WORKS WHEN YOU TRY TO BUILD ON MSVC
 
And I'm not even talking about betas or fresh features.
I'm talking about features that have supposedly been around for three or four major releases.
 
You know what. I worked with it. And yes I had my regular "ermagod nothing compiles on MSVC moments (days)" [just check the transcript] but by and large it is possible for me to use it without feeling totally handicapped
 
@sehe Thanks--that's definitely an improvement.
 
@DonLarynx Because the site is not cared for effectively.
 
4:26 PM
can we dupehammer ?:
-4
Q: Creating a array of class objects (C++)

jimbo bobI have been trying to make a simulator which involves ants randomly running around (for now...) I want to make a array of "Ant" to contain all my ant information and later functions. How would I do that?? (example with my code if possible)(I know java fairly well so if you could relate it to java...

 
@Mgetz No, not any more. :-)
 
really? they removed the dupehammer?
 
so I just bought a tablet
 
oh nm I seee your joke there wasp
@BartekBanachewicz Did you get some chalk too?
 
@Puppy ha ha those ancient jokes
> , and you'll get an extra £25 off the tablet, bringing its total cost down to just £49.99. The deal is sweetened further by the inclusion of a free one-year Office 365 Personal subscription (and a 1TB on SkyDrive)
 
4:33 PM
@Puppy What? You actually took something I said seriously? Even for a moment? What is the world coming to?
 
a slightly different location relative to the supermassive black holes at the core of our galaxy, I guess
 
@Puppy Inevitably so, I suppose.
 
@R.MartinhoFernandes "The uploader has not made this video available in your country. Sorry about that." Maybe I didn't miss a lot though...
 
@JerryCoffin HA!
 
4:37 PM
@R.MartinhoFernandes BlackHoles 6: Revenge of the GEMA.
2
 
4:50 PM
Ugh.
block_manager
I should have reviewed this code before I had to fix the bugs in it.
Unsurprisingly, it's just a collection.
 
@R.MartinhoFernandes Hmm...maybe we should rename the standard library collections. deque->multi_block_manager, vector->single_block_manager, list->sequential_node_manager, set -> indexed_node_manager, map -> indexed_node_with_associated_value_manager, multimap -> indexed_node_with_multiple_associated_values_manager. Management shall rule the world!
3
 
Hmm, the word "manager" would actually not imply that the thing holds and owns the 'managees'.
For instance, I guess a collection of 'managees' could have more than one manager, each one for a different managerial task.
 
ManagerManager
 
5:06 PM
2 hours ago, by Jerry Coffin
@R.MartinhoFernandes So do you have a manager_manager?
@R.MartinhoFernandes I have 8 bosses (yes, I know, obvious--but unavoidable).
 
5:20 PM
@JerryCoffin I call that a vice_president
 
loooool
Mgetz gets it
 
Mgetz it
@R.MartinhoFernandes rename it GEMA
 
5:39 PM
@Mgetz I suppose that depends on the company--some have several layers of "directors" and such between "managers" and "vice presidents" (and then there's Italy, where "vice president" refers to the president being convicted of vice crimes).
8
 
@JerryCoffin lol
 
Yay I scored 44k at Falling Fellow
 
(actually random pause moment)
 
@JerryCoffin lol starred for accuracy
 
yo
 
user1804599
5:52 PM
hi there
 
@JerryCoffin Smooth.
 
user1804599
@R.MartinhoFernandes make a post-receive hook which greps for "manager" and notifies you.
 
I wonder, at VICE, is the VP the actual president?
 
@EtiennedeMartel somehow I suspect they use Editors not presidents
 
So, I stumbled on an online version of Keynes' The General Theory of Employment, Interest and Money.
Looks like pretty hardcore stuff.
I wonder if I can go in there without feeling lost right away.
 
5:58 PM
Failed how? Do unnamed horrors from beyond space-time leak from the screen? — Alex K. 5 mins ago
lol
 
@EtiennedeMartel I'd guess you can. I've read parts, and never felt particularly intimidated, anyway.
 

« first day (1620 days earlier)      last day (3310 days later) »