« first day (1007 days earlier)      last day (4167 days later) » 

05:00
Normally, if you take an object as a parameter and don't modify it, you'd take it like const Type &.
With lvalues, that works great, but rvalues need a bit more to fit it. If performance is a big concern there, you can overload it to take an rvalue reference as well. Typically not needed, but could turn out useful one day.
@chris I think if you just need to read and not store the parameter, then const T& would suffice. It's only when you need to store the parameter will a move overload necessary.
@chris I sincerely doubt anything I do will face a performance issue of this magnitude.
@MarkGarcia Maybe, it's late (early) again :p I remember Andy and finding out (Type type) : type_{std::move(type)} is better on average than (const Type &type) : type_{type}.
@Chemistpp Even if you don't explicitly use move semantics, you'll still see a significant performance improvement as the compiler will optimize copy operations that could be done with move instead.
I guess that's more the example I should have used. You can overload that to be a bit more efficient, but it isn't usually worth it.
05:06
It's amazing how much C++ has changed in the last 10 years. I'm getting old. I'm still reading about rvalues ;) I like the comment "In C++98, you would have used the copy constructor" And then I felt excited I knew that one already.
@Chemistpp It's about time, seeing as how C++98 was the last major language progression :p
@MarkGarcia Thank heavens. I'm using VS 2010 right now. Thinkin gabout getting 2012 professional while I can. I'm a student and can get it for free.. for 13 more days.
@Chemistpp Same reasoning: just because you're getting old doesn't mean you should stop learning. :)
then I'm done with school forever
I know, I'm 28, just finished grad school
want to be a prof in chem
life timer learner
@Chemistpp Congrats!
05:08
aThanks. I have a job interview with Oxford on Monday
I might move to England
super excited
That would be awesome
13 more days...
spend the next 3 years getting to travel throughout europe
Yeah, I graduated, but my boss kept me on to finish a project for the summer while I found a job
and this one is over in 13 days
In a month and a half, I'll be starting real school.
@Chemistpp Most regulars here live in Europe.
so I'm no longer a student
05:09
Your joy is what I get to look forward to.
@chris real school?
@chris grad school?
@MarkGarcia I'm catching on to that. ;) I'm not your typical American.
@Chemistpp University. I don't consider high school all that effective. It's good for some things, but caters far too widely to be of any real use.
@chris High school was damned joke in the US. I slept through every class and got As on exams. Watch out for the drugs in college
they tore me up one year, almost failed out for a minute
Pfft drugs. Good luck.
Now I'm just a pot head
I gotta look up the laws in England
I watched lock stock
O
05:13
I should have just answered that string question. I need the rep.
Wow, where's the RTFM close reason
That operator |= question is such low effort
i know
@Rapptz All questions asking what an operator is (used for) are low effort.
close it close it now
Step 1: Operator precedence chart. Step 2: Google the name.
05:16
Not if it's overloaded bud. — Rapptz 6 secs ago
or just C++ operators
Can we just close this?
Skip to step 2 if you know the name.
i VTC already
50.1k rep person answered it. Holy shit.
05:17
Come to think of it, you know Boost's vec | sorted | reversed syntax?
@Chemistpp depends what you do in hs man
Does that use operator|=? I want to post a clever answer :p
VTC instead, this question is just awful
Took me long enough to remember the word adapter.
the question is already -6
05:19
daww
lol
I wanted to post my answer:
0
Q: Value and size of uninitialized std::string variable in c++

CharzhardIf a string is defined like this std::string name; What will be the value of the uninitialized string "name" and what size it would be?

`x |= y` is _almost_ equivalent to `x = x | y` for integral data types.

The main difference is that in the latter case, the (x) expression is evaluated twice.
lol. The std::string question's OP accepted the lowest voted answer. And that answer quoted from cplusplus.com.
05:19
The guy chose the lowest score ;_;
That happened to me too
Us all.
6
A: my do-while loop doesn't end

BorgleaderIt will never be true because you are comparing pointers not the actual string content. Yet another reason you should use std::string (the comparison operator for this will compare the string itself). The C way of doing this comparison is to use strcmp, the C++ way is to use std::string and rely...

4
A: c++ if statement not working in overloaded "++" postfix operator

Magtheridon96if(day = 365) {day = 1;} else {day ++;} This does not do what you think. = is the assignment operator. == would be the comparison operator. Currently, that expression is assigning the value 365 to the day variable and it's returning 365, which executes day = 1; (Anything that is not 0 is true) ...

05:20
the chosen answer was 0 or 1 when it got picked
I even spent 10 minutes formatting all his code
One time I answered 4 seconds late
and the guy got 15+ upvotes than me.
for the same exact answer
lol
That's FGITW for ya...
that sucks though =/
@Mysticial Were not all so fortunate to have answers with a bajillion upvotes :(
05:22
If you're claiming that == does the same thing, please provide an SSCCE so we can reasonably figure out what's wrong. — chris 7 hours ago
ok If it's ok, im going to post the whole code guys — bigdog225 6 hours ago
Took them long enough.
And not much of an SSCCE either.
@Borgleader But at the same time, we have a tendency to lounge each other up.
Yeah but you get a shitton of passive rep, most of my passive rep is on the "only one main answer"
@Rapptz Somewhat reminds me of my Why can't the address of nullptr be taken? thing.
and i only get like 1 every 1-2 weeks
It's an LSEWE
05:23
@Mysticial lol
Not an SSCCE
Long, Self-Expanding Wrong Example
I posted this earlier but do you guys think this answer makes sense?
@chris Oh, you made me wonder.
Alright, time to go to bed if I want to even have a remote chance of coding something tomorrow.
(Instead of spending all my time lounging & repwhoring)
@Rapptz Yeah, that was something a lot of people are looking forward to.
05:26
6
Q: Definition of class and variable with the same name

scdmbThere is this code: int x; //void x(); // error: redefinition of 'x' as different kind of symbol class x {}; // works ok int main() { return 0; } Why is it legal to define variable and class with the same name but it is not legal to define variable and function with the same name?

This is the most ridiculous one
@chris I'm looking forward to it. :P
The accepted answer was tens of minutes after mine and I had >2x the number of upvotes :p
@Magtheridon96 Well, he quoted the standard. :)
@Rapptz Lounged up :)
@MarkGarcia I should keep a whole copy of it on my desk ;-;
05:28
@Mysticial It actually had 6 upvotes before I linked it. :P
@Magtheridon96 If it gets more, you can hope for that 2x unaccepted answer badge.
@ Mark Garcia: I'm already have seen delete button, but it always give me a message , you can't delete the questionLion King 57 secs ago
^ Any ideas?
I just said something about that.
@MarkGarcia Answer has upvotes.
@chris O:
05:29
@Rapptz Oh.
@Magtheridon96 Yeah, I lied. 12 vs 5 is going to take some work.
I didn't know the numbers :p
asked 2 months ago
viewed 171 times
active 2 months ago
And that question is pretty dead
The answer he's competing against needs 10 upvotes iirc.
11 I think.
Just realized I had a half-finished episode of Zoidberg minimized.
From hours ago.
Dang. You repwhored that question.
05:32
I once realized I had a porn video playing in my other browser hours later
Good thing no one was around when I clicked the Firefox icon and it popped up in my face
You're both repwhoring that question! /cc @MarkGarcia @chris
I need to get into repwhoring and get the legendary badge :p
@Rapptz Still not getting any reps, yet.
I do that from time to time.
05:35
I need to get >200 rep for 148 more days to get it
@Magtheridon96 That's my answer!
@Rapptz It's a lovely answer <3
Bad time for rep whoring for me. Very slow connection. :(
You have 3 upvotes.
05:37
@MarkGarcia It goes pretty badly for me when the C++ page doesn't update to say x new questions until I refresh.
@chris Auto-refresh here doesn't work here since we had this network proxy.
Ah, there's the dupe. I figured there would be one.
@MarkGarcia I don't even have a proxy, but when I tried Hola, it stopped working completely.
OMG. 14 reps 'til 3K!
Now it's off and on. And refreshing doesn't actually show the question until like a minute later.
05:39
50 till 4k~
@Magtheridon96 Let's go rep whore!
Sometimes I see the new question thing pop up right before I refresh and don't see the new question for a minute >.>
@chris I have that happen too
I need 5 upvotes for rep cap.
@chris I usually click the "Newest" tab and get the latest question. Using refresh doesn't give the latest question on me (most probably because of the cache).
@MarkGarcia That doesn't work either.
05:41
wait
SQLServers can have viruses ....?
is this like an injected DLL
It frustrates me having no idea why the auto update doesn't work.
@MarkGarcia I'm waiting for good questions to pop up
Well, sometimes works.
You guys use Firefox?
I use Chrome.
Chrome
05:42
@chris Hmmm... There's that online test to check websockets and those kind of things...
@Rapptz Firefox. Nightly.
I use Chrome
or you could just not rep whore
I tried out Opera 15 today, but it honestly needs some work before I'll be able to actually use it. At least the scrolling in it actually works, as opposed to 12.
it's annoying
I only use Firefox for browsing porn
05:42
guys.
It's not in my mainbar so no one finds any of it /o/
@MarkGarcia It did seem to work fine last week with a different internet connection, but I'm pretty sure it goes off and on with that one as well.
@Magtheridon96 I only use Visual Studio for browsing porn.
5
> WebSockets Might Work for You!
05:45
WebSockets seem to
Work for You!
Comet failed to work
Environment
WebSockets supported Yes✔
HTTP Proxy No
WebSocket protocol version rfc-6455
All others are yes.
"seem to" and "might". :(
@chris lol. Well, I haven't tried VS to browse, much less watch porn using it.
And it seems to happen much less often with auto-updating new answers, votes, and comments.
@MarkGarcia ctrl-alt-R
Getting time-outs in chat...
At least on VS2013.
There are no good C++ questions now :<
05:48
4 more!
Yay! 3K reached! I suddenly feel the urge to VTC!!!
Dang, someone else UVed it.
I whored so much yesterday. Including lost reputation, I made 330, and they spilled over to today, where I earned 75 more :P
I was going to take it back for a bit after you said that just to mess with you.
05:51
:)
@chris Sorry to ruin your fun that way...
Ok, well, I randomly reinstalled Chrome in a desperate attempt to make things work.
And the auto update is working for now.
I give it 5-10 minutes.
First VTC. On a question that I have the top voted answer. :p
0
Q: C/C++: undefined reference to function in another c file?

Kevin MelkowskiI am trying to compile a shared library with multiple types of functions. Problem is when I do I get a bunch of undefined references such as radixSortFloat. Here's the list of error's I get: gcc -Wall -c Histogram_64.c -lpthread -fopenmp gcc -Wall -c Histogram_32.c -lpthread -fopenmp g++ -st...

Oh god, and it's not even a good one
My first thought when I see that in a title is "##so linker"
So useful these things are. No more bookmarking all of them.
06:00
0
Q: C++ CSV Parsing with Commas Inside of Quotes

Drew DielmanI'm building a C++ CSV data parser. I'm trying to access the first and fifteenth columns of the file and read them into two arrays using getline commands. For example: for(int j=0;j<i;j++) { getline(posts2,postIDs[j],','); for(int k=0;k<14;k++) { getline(posts2,tossout,','); ...

Can I quote him and just say "Yes"?
@Magtheridon96 Hmm... this can be done without char by char reading.
I have an idea. Let's post every new C++ question in here from now on.
@chris But be sure the bin master(s) are not here.
nope
I feel like binning T_T
My space ;_;
06:08
do it.
I have 5.2k messages ??!??!
How did this happen?
e-mail?
@MarkGarcia SO chat in total.
one word: whore.
06:11
@refp Does the period count? :p
@MarkGarcia as a word? only if you're retarded.
@deadMG @EtiennedeMartel clearly said it the room at large on many occasions. Also, jobs will always ask for much high experience then they actually want, as it helps put off the really bad people. Assuming you can get used to using C#, I don't see why you would have any problems skill wise, though you will have to try hard to prove you are not an idiot after not completing Uni.
@refp Retarded? Sometimes. I don't know. :)
good morning and welcome to Lounge<C++>, I'm an ass, you're an ass, we are all asses (def' *not assets).
I've somehow managed to shift my afternoon snacks by 12 hours.
06:13
@MarkGarcia is that why some people put a space before their period/question mark, because they think it's a word? stupid people ? I don't like those who do this .
@refp I used to put two spaces after my periods and one after other punctuation in like grade 4 and down or something like that.
@refp Well , yes . And... they also... do... this...
@chris yeah, putting more than one space efter your period was often thought in schools (and still is, but not as often as "back in the days") (or atleast so I read when looking into the subject)
@MarkGarcia :*: ::...
@chris but we are talking about putting spaces before punctionation, I hope your teacher didn't force that sort of thingie upon you?
06:17
@refp I think I might have been taught that way at first.
The 'two spaces after punctuation' is a stylistic thing, supposedly makes it easier to read. Though now that we have 'styles' for anything computer based, if you manually type that second space, IMO your an idiot
Putting two spaces after a period was standard on typewriters, which (at least mostly) used a monspaced font. Proportional spacing and kerning render it obsolete.
Again my youth gets in the way of my knowledge.
<- often uses his typewriter, doesn't put two spaces after period
@chris your.. youth? you are 19 (according to your SO profile), you are certainly not a youngster anymore.
@refp uses typewriter; hipster
06:19
@refp And I've never really touched a typewriter or known the reasoning behind two spaces.
@thecoshman been using one since the age of 5 (when my grandma left me one); hipster before it was cool (or whatever).
I'm still very young to a fair number of people here. It's funny how our notion of who's too young to ___ changes as we grow older.
@chris you can't blame your age for that, the latter could be because of ignorant or typical "meh, don't care". the former, well my brother is 14 and he has touched one - you need to step up (and no, we are not talking pussy).
@refp I don't think I've ever seen one in real life to be honest.
@chris You don't touch touch a typewriter. You hammer it! And sometimes dig your fingers in.
06:21
One that I would be allowed to use anyway.
@chris then I feel very bad for you (if you haven't even seen one my guess is that you haven't really seen that much of this world)
heck, whom am I kidding.. I don't feel bad for @chris. this is the internet. I hate everyone.
@refp Probably moreso than not.
Take your hate out on the people arguing over the Cheerios commercial.
thanks, but no thanks.
It's so stupid because as soon as you get involved by saying it's stupid that it has any controversy, you're arguing over it.
ah come on, typewritters are over, have you ever seen a pre-historic stone spear used to kill animals thousands of years ago?
06:24
@chris shut the fuck up, that's stupid.
@thecoshman I'm not sure where you are going with this but.. yes?
I mean in person, physical holding, even getting to use it?
@thecoshman I've seen one in person (in museaums of course), not allowed to hold it, I've not used it.
Typewriters require only a relatively gentle touch. A manual card punch -- now that's when you hammer. May have told about him before, but back in the mainframe days we had a guy who'd spent years at a manual card punch. When he typed, he pulled his arm up to vertical, then swung it down at the keyboard, and repeated. They bought him a terminal with a detached keyboard (back when that was expensive) because he'd destroy a keyboard about every three months.
but we are not talking about something from thousands of years ago.
@refp well bleh bleh can't have seen much of this world bleh bleh
06:29
__DATE__ is not a standard C11 or C++11 macro. — chris 36 secs ago
Yeah it is
@thecoshman I was kinda serious (but only kinda).
but more towards the serious side than anything else
@Rapptz let the guy be, apparently he's young! ;-)
@refp bleh bleh bleh, child
@Rapptz o_0 why no one box?
Because cppreference doesn't one box
06:30
@thecoshman are you?
@thecoshman I learned to type on an IBM Selectric. I've also used manual typewriters, though not nearly as much. I've also done programming on a DEC LA30.
@refp no, you ¬_¬
user142019
@jonskeet I'm not sure what it means to "conditionalize attribute application," but it sounds badass and now I also want to do it.
user142019
LOOOOL
@JerryCoffin I wished for an electric one when I was about 7 but I got kinda disappointed, not the same thing really
06:32
@JerryCoffin oh yeah, electric type writer, crazy idea.
@thecoshman stop it, you are childer! *blushes*
I like the ball type write that I think IBM made
@thecoshman That's the Selectric (see above).
speaking of weird things.. a former work friend of mine, seriously, used one of these every once in a while:
@JerryCoffin I thought they had a pure mechanical version
@refp lol, the mirrors fucking make that thing :P
06:35
@thecoshman he was silly looking as it was.. with that thing he blew barriers
@thecoshman You mean a manual, but with the type ball? I suppose it's possible, but I don't know of such a thing. I should point out: although powered electrically, the Selectric was pretty much purely mechanical.
@Rapptz C++11?
Yes.
_ _ DATE _ _
The date of translation of the source file: a character string literal of the form "Mmm dd yyyy", where
the names of the months are the same as those generated by the asctime function, and the first
character of dd is a space character if the value is less than 10. If the date of translation is not
available, an implementation-defined valid date shall be supplied.
@JerryCoffin that is what I meant exactly. I am sure there was such a thing
@Rapptz Ah. It has spaces.
06:35
c++3000, that standard is going to be AWESOME
__DATE__ (I'm too lazy to hit sandbox)
Those spaces screwed me up >.>
@JerryCoffin what was electric about it?
0
A: Different format of __DATE__ macro

Jens GustedtIn C you could have a macro that generates a compound literal on the fly that has the order that you like, something like #define FDATE (char const[]){ __DATE__[7], __DATE__[8], ..., ' ', ... , '\0' } in all places where it matters your optimizer should be able to handle this efficiently.

the problem with waking up early is that I now look out the window every 2 minutes trying to see if there's sun on the balcony yet
Badass answer.
06:38
Oh fgs I opened WMP once and now all my file associations are messed up.
@thecoshman The power to move everything came from an electric motor.
@MarkGarcia if that actually was allowed, yeah.. sure
or well, it's probably allowed in C99 but def' not C90
@refp It's illegal?
@refp Yeah, I think C allows it.
Compound literals. GCC has an extension for them, too.
it's definitely illegal in C90
06:41
@thecoshman I'll take your word for it. As I remember them nearly all manual typewriters were roughly like this. You hit the key, and a lever with two letters on the end swung forward and hit the ribbon against the paper. The shift key actually moved the whole assembly of levers up a little bit so the second letter would hit the ribbon instead of the first.
@refp According to this, C99 supports them.
@chris C90 != C99.
@refp I know, you sounded unsure of when exactly they would have been introduced.
@JerryCoffin fairly sure it was a youtube series 'the enginer guy' who showed how that ball worked. Some fancy levering allowed the 'movement' to be pure mechanical...
@thecoshman That sounds like a Selectric -- essentially all of it was mechanical, just the power to move the rods and levers and such came from an electric motor, not your fingers.
06:44
It doesn't work in C++ though.
Can't get to compile: warning: ISO C++ forbids compound-literals
personally I don't care much for C99, it's like the comittee thought; "the more fucking weird proposals we get into the standard, the more we will get laid". jokes on them; they are writing C, they will never get laid.
Yeah like I said, it doesn't work in C++
I tried that first but got that warning
so I decided against it
@Rapptz isn't compound-literals illegal in ISO C++?
Yes.
06:47
that wasn't even funny.. thought you'd catch on to me trollin' and rage a bit :-(
@Rapptz, C++ should have possibilities to create similar temp objects on the fly. Whether you could achieve something that would be optimized as this one in C, I wouldn't be sure. — Jens Gustedt 47 secs ago
?_?
@Rapptz In C++, you'd probably want to do it with a constexpr function.
It'd be a lot easier with functions but the OP placed a constraint for macros.
morning
06:52
@ArneMertz NO.
@refp why not?
me being in here could easily be replaced by a bot just replying "No" every once in a while.
@ArneMertz exactly my point
@refp wtf I don't get you oO
@Rapptz Yes, but a constexpr function essentially is a macro (i.e., something you can count on happening at compile time, not run time). Note, I'm posting it as an answer -- but between us, the basic point of constexpr is "macros that aren't quite so fucked up."
Go for it!
06:55
[Though of course, the reason they're not so fucked up is that they're not implemented as macros.]
@ArneMertz really, what about lunch?
@JerryCoffin you can count on happening at compiletime if done right and if evaluated in a situation where a constant expression is needed iirc.
@refp I'm at breakfast
@ArneMertz Yes, of course.
@ArneMertz yeah, but won't you have massage later?
had a twitter conversation about just that topic yesterday - someone implementing constexpr pi() { return std::atan(1)*4; }
06:58
@JerryCoffin essentially? not really.. a macro is a fancy "find and replace", a constexpr is not at all that
@JerryCoffin the only thing compile-time with a macro is that the text involved will be replaced during the pre-processor face, nothing more.

« first day (1007 days earlier)      last day (4167 days later) »