« first day (649 days earlier)      last day (4317 days later) » 

4:00 AM
How do you get those?
 
The olympics.
 
I mean, why are people bothering in getting those?
what do you get when you get those?
 
He doesn't try.
 
@nambla, Do you have a specific question about it?
 
tons of chicks.
they love badges.
 
4:00 AM
And the badges are just to encourage good behaviour.
Something to look forward to
 
@KeithLayne He doesn't need to try. He's the most active and most popular user. So that attracts thousands of people to his profile.
 
Nah, I need to hire someone with reverse engineering knowledge. and code a emulated server.
 
And they randomly upvote his posts.
 
Hhaha. good for him.
 
@Mysticial um...
 
4:01 AM
So he gets laid a lot?
 
@nambla This isn't exactly the place where you'd find someone with those skills.
 
@nambla, I found a site for freelance hiring, hold on
 
mwahahahaha
he is married
 
@nambla I don't know, why don't you ask him?
 
Nah, was just asking around. :)
Oh, thanks.
 
4:01 AM
@KeithLayne That doesn't mean shit.
 
That isn't something careers would do, right?
 
and he goes to church on Sunday. It's one of the few times he's not on SO during the week.
 
haha. Group chat is hard to comprehend. I don't know who is talking to who.
 
@Mysticial It does to me!!! <emoticon> :P
@nambla you don't know who is talking to whom
 
Oh right. 'whom'.
:)
 
4:03 AM
@nambla, I think someone mentioned this site to me once.
 
We are grammar and usage Nazis here.
 
Oh god why is my name nambla
 
dude, you totally have to make up a good story to explain it.
 
Its good to be with grammar Nazi's.
I'll learn to use correct gramming >:)
 
I was kidding.
 
4:04 AM
say you lost an epic battle with your sibling at the keyboard
and the result was that series of characters
 
weak sauce. There should at least be aliens or some kind of global conspiracy.
but you can throw in the keyboard fight for good measure.
 
Getacoder a good site?
 
but siblings? No.... ninjas
 
I haven't used it or anything. I just knew it existed
 
Ninjas
So does guru.com and freelancer.com
All you get is alot of scammers who doesn't even know english.
 
4:06 AM
that's great.
maybe they get a little nervous when nambla comes poking around?
 
O! My God. That's it!
That must be it.
Or they
potato.
Anyways, What kind of community does stackoverflow has?
I mean, I found this site because I haz alot of coding questions.
I didn't know there was a huge community here.
 
SO is retarded. Don't get involved. People are either dumb or jerks.
 
SO will turn your coding habits into idiomatic ones in a week given enough questions
speaking from experience
 
SO chat, on the other hand, is superawesomeness
Not to say SO is not chock full of good info
but the real brain trust, at least in C++, hangs out here
 
Are you all c++ coders?
 
4:11 AM
probably similarly for the other topics in chat
not really everyone
 
compared to other SE sites, SO is a bit more harsh on things sometimes
 
but it's a favorite language
 
and this room is more of one of the only really active ones
 
What are SE sites?
 
it sort of combines a lot of different discussions
 
4:12 AM
@nambla No -- I'm purely a poser.
 
wow that comes out faint
 
@je
Oh god, I don't even know how to use the chat functions.
 
yeah, and as long as you act not douchey while you're here, and get to know people, and learn to listen to the smart people about the technical stuff, it will suck your life into oblivion
 
lol
SE, stack exchange.
 
just yell at the computer until it works. That's what I do.
 
4:13 AM
@chris Speak for yourself. I spend too much time on chat to be nearly as active as I should be (and my weight shows it).
 
@keith.layne, Thanks for reminding me
 
ha, my name changed
 
@JerryCoffin, I'm not active at all, my metabolisms still like 11/10 though, so im good for now
 
Seem's like everyone here uses the correct grammar. Is LOL even accepted here?
 
@nambla, Look at my last post.
 
4:15 AM
@chris Ah, I remember those days. Enjoy them while they last (and no, I'm not being sarcastic -- really do enjoy them. I certainly did, and really don't regret it).
 
not correct at all, I tend to use excessive commas to separate things in chat
 
@chris, which post?
 
@nambla the first rule of Lounge<C++> is...
don't talk about Lounge<C++>...
if you're going to use corekt grammer
@chris not with the commas again! :)
 
I need time comprehending all this.
 
just wait until you start comprehending c++...
 
@KeithLayne C++ is like quantum mechanics. The minute you think you comprehend it, you've just lost all touch with reality.
 
so true
 
Ha, to use quantum effects you don't need to understand anything about it. Your analogy...I poop on it. :)
I'm waiting for you to crush my soul now.
 
quant...what?
I
 
more quantum tunnelling please
 
4:19 AM
@KeithLayne You claim to have a soul? Ha! Like I'm going to believe that!
 
I'll be back with some knowledge.
For now I will lear... nevermind.
 
> bool CopyUpToFourColors
 
Its funny.
But I don't get it.
 
dude, I can't stop laughing at that.
 
Maybe because I'm no quantum mechanic or some of that stuff.
 
4:20 AM
> if (buffer == nullptr)
that is the scariest part
 
Nope, still don't get it. But still laughing my ass off.
 
You don't work on quantum cars?
 
Nope, I don't.
 
charge tunneling is the coolest.
 
Where do I learn such stuff?
Do I go to college for that?
 
4:22 AM
quantum physics? Or c++?
 
Can we have cars that when someone on the other side of the world fills their gas tank, mine fills too?
 
quantum entangled gasoline?
 
Uhm. I was kidding. :)
quantum entangled gasoline. QEG. That's.....never gonna happen.
:P
 
you're so narrow-minded
 
Oh, one thing. I'm no c++ coder. So how do I learn?
 
4:24 AM
read. read. then...read. after that, read some more. The whole time, code as you read. But read good books and blogs and talk to people here.
there is much to learn, young jedi.
 
@nambla if (you've_written_other_code) get(Accelerated C++) else get(C++ Primer, 5th Edition);
 
Oooh. I got that :)
 
Just pointing it out that you're about to get that badge
 
Me?
 
4:25 AM
there is much to learn for me as well (very, very much)...so don't get the wrong impression from me.
 
@JerryCoffin I'll check those.
 
Now I go to read myself to sleep with standardese. It's the best thing I've found.
 
Which ones the bad one, Primer Plus? I think it had primer in the name somewhere...
 
@nambla C++ Primer, 5th Edition isn't out quite yet,but should be within a month or two. Make sure to get the one by Barbara Moo -- there are a couple of others with similar names, but they're substantially inferior.
 
@Ell Dude, that's the ticket. If you can't sleep, read the standard. There's no way you can last more than 30 minutes through that.
 
4:27 AM
Barbara Moo, same author with Accelarated C++
I'll check.
 
dude, that can't be her real name.
 
lol
 
@nambla in some ways, you are at an advantage starting now. You can ignore old stuff that is poopy and learn the new ways of the force from the start.
 
@KeithLayne Why. Do you think somebody would use that name if they had lots of other choices? (Believe me: I have plenty of experience with that!)
 
@JerryCoffin we all know you're in witness protection.
 
4:29 AM
I'm a jedi. An... advance Jedi?
Be right back.
We'll try to check where I can get these books.
 
@JerryCoffin her name reminds me of a song from the '90s, but I can't quite put my finger on it. Something about Mary Moo being a vegetarian.
Great. Now a 3 second snippet of a song I can't remember is on infinite repeat in my head.
 
New Age girl :)
 
well played, sir
 
by Deadeye Dick, I think.
Good old songs. Got it on my playlist.
 
sounds right
 
4:32 AM
Would you like some fries with your code? — Luchian Grigore 24 secs ago
^^ lol
 
@Mysticial RVO is not required in C++11.
 
@LucDanton It isn't?
Where did I hear that from?
Going Native
 
this is stupidly easy, it doesnt deserve a question on SO. you should try it. also sounds like homework so put homework tag if it is. — Preet Kukreti 1 min ago
Preet Y U SUCH AN ASSHOLE?
Summer of love, bitches, summer of love.
 
Opening of the relevant paragraph: "When certain criteria are met, an implementation is allowed to omit the copy/move construction of a class object, even if the copy/move constructor and/or destructor for the object have side effects."
Key word: allowed, not required.
 
I swear one of the speakers in the GoingNative talks said it was required and I took his word for it...
I guess it was all BS then.
 
4:40 AM
Oh, I was looking for lambda. Not nambla. Google? Y U make me pedo. :(
 
Does anyone remember a near-identical question earlier? stackoverflow.com/questions/11662367/…
 
y u in such a rush to squash his question?
 
What if I told you guys I learned C++ from cplusplus.com?
 
I would fart in your general direction
 
:D
Not the forums, obviously...
 
4:46 AM
@n2liquid, I'd say read this to find out what your head's been filled with.
 
@LucDanton Is C++11 required to use move-semantecs if available on a return value? Or is even that also optional?
 
It's not all bad. You have to be pretty knowledgeable about c++ to know where most of the errors are. Except using namespace std; Ew.
 
I'm trying to track down what exactly I heard from the GoingNative talks that made me think RVO was required.
 
@chris I know about that, that's why I thought it would be fun to tell you :D
 
@Mysticial Depends what you mean by 'available'.
 
4:48 AM
I basically read The C Programming Language, then their quick tutorials on the most utterly basic stuff, and the rest was 99% usage
 
Morning boys
 
Believe it or not, I found a piece of information that was on cplusplus.com, but not cppreference.com
 
@LucDanton As in if a move-constructor is defined. Obviously code freshly ported from C++03 won't have move-constructors. So I'd assume that a C++11 compiler is supposed to just use the copy/assignment constructor?
 
@KeithLayne And god I hope that trial comes up soon!
Seems like I've been waiting forever...
 
@ManofOneWay Don't make me feel worse than I am already for staying late at night in the internets ):
btw hi
 
4:52 AM
@Mysticial Generally speaking for both C++03 and C++11 return expr; uses copy initialization. This means that what constructor ends up being used is determined via overload resolution. Rvalue references and move constructors were designed to fit in there -- that's not preferential treatment.
(The 'copy' in copy initialization can be misleading.)
That being said, local variables with automatic duration (including parameters) do have a special rule that they're first treated as rvalues in an attempt to perhaps call a move constructor.
 
@LucDanton You're talking about cases when no RVO is possible, I take?
 
@Mysticial Yes, if available it's required.
 
@n2liquid RVO works in tandem -- first a constructor is picked, then it may be elided.
 
@LucDanton So in other words, if a proper move constructor is defined, then C++11 requires that move-semantecs be used on a return.
 
@LucDanton I don't get it; but is this compiler internals or is it something that is somehow part of the language?
 
4:54 AM
@Mysticial Well, no. struct foo { int i; }; foo make() { return { 42 }; } involve no copy or move construction.
 
yes
 
@JerryCoffin ah ok... so THAT's what I should've heard from the GoingNative talks. What I head instead was that RVO was required.
 
@n2liquid Stay high-level. You're not writing instructions for the compiler, you're writing C++.
 
@LucDanton Oh, wait.. I might just have been enlightened
 
@LucDanton Isn't that just a degenerate case?
 
4:56 AM
what you mean is that RVO never happens if, for example, the object's copy constructor is forbidden?
that's what I understood from your "first a constructor is picked, and then it may be elided"
was that it?
 
@Mysticial My point is that the copy and move constructors are not special in any way. They are picked (if they are) via overload resolution. Rules of the kind "an implementation must move/copy the object in such and such situation" don't fit with that.
@n2liquid That's definitively an example of why it's important to stay high-level, yes.
 
@LucDanton I'm curious if that's what you meant, but I'll leave that for another opportunity; gotta go now
bye, folks
 
@n2liquid Notice the 'yes'!
 
@LucDanton Ah ok. So the rules of overload resolution "forces" move-semantecs to be required in such case. If I'm reading that right...
 
@Mysticial Tbh I don't know what you mean by move semantics. The move constructor is a constructor like any other -- would you say that bar make() { return bar(quux, 42); } will involve 'copy semantics'?
 
5:01 AM
@n2liquid G'night.
 
@LucDanton I'm trying not to think about it from a 100% pedantic view.
@n2liquid night
 
@Mysticial Imo you're making it all more complicated than it is.
 
What are you talking about? When RVO is used?
 
I probably am...
 
But to be fair, there are two ways to look at moves. Either you decide that any construction of the kind auto foo = rval; is move construction (where rval is an rvalue), or you decide that only constructions that involve a call to a move constructor are moves.
One view is important for generic programming and that's what you get with e.g. std::is_move_constructible. The other is important when you do need to care about avoiding copies.
So what kind of move semantics do you want to talk about here?
 
5:06 AM
@LucDanton There's more than one type? The only one I had in mind was the first one you listed: auto foo = rval;
 
Okay. Then you get those moves every time return expr; involves an rvalue of the same type as the return type (or is more derived from that type), or even when it involves an lvalue provided it's the name of a local variable (more or less).
So both foo f; foo make() { return std::move(f); } and foo make() { foo f; return f; } involve moves.
 
clear so far
 
That's all there is.
 
ah ok
 
RVO may or may not remove actual calls to constructors.
(Reportedly something like foo make() { foo f; return std::move(f); } makes it harder for implementations to apply RVO so you'd want to avoid it if your compiler lets you get away with it, which it must, but you know how it goes for that compiler.)
 
5:10 AM
but the move constructors will always be called if defined. And that's what I probably misheard from the talks.
 
@Mysticial Not, not always.
 
3
Q: Is an object guaranteed to be moved when it is returned?

haotangI know that when passing an object by value to a function, the move constructor is always called if there is one, assuming no copy elision. What about returning an object by value? For example, say we have a class Foo which has a move constructor, and we have a function that returns a Foo object...

 
@JerryCoffin nice find
 
If you have struct foo { template<typename T> foo(T&&); }; then the move constructor for that type (the one that is implicitly declared and defined) won't ever be called.
That's due to overload resolution -- as you can see that's the one thing that governs what constructor ends up being called. (Or being required to be accessible if RVO ends up being applied.)
 
@LucDanton And I think I just lost you on those last two comments...
 
5:14 AM
Remember how we decided that we would define a move as something like auto var = rval;?
 
gimme a sec to finish reading that question
Ok, @JerryCoffin's last sentence in his answer is clear: "To answer what you may have been getting at, though, the general rule is that moving will be done if possible, and it'll fall back to copying if and only if something prevents the result from being moved."
Now I can get back to the cases that would prevent it.
@LucDanton yes, go on
 
That doesn't mean that in auto var = rval; a move constructor is necessarily called.
A trivial example is int i = 0;.
 
Right
Likewise a global or anything that's still alive after that statement.
 
The same goes for more involved example. foo make() { foo f; return f; } is a move but we can't know beforehand what constructor (if any) ends up being called.
@Mysticial We wouldn't have an rvalue on the rhs though unless we were to use e.g. std::move. And if we did, then it would still be a move, and could in fact call a move constructor.
 
I think I get it now.
Thanks for bothering to clear up my mind over this.
 
5:28 AM
/me slaps Mystical with a wet trout
just like IRC :)
 
@user92979 ow :)
This is why the SO tag system is broken...
I just got lectured by someone with 1/6 as many votes as I have in C++.
And I'm thankful for it too. :)
 
5:45 AM
hey guys, just a quick question on cross compilation.
I've been through SO posts, but I want to specifically know..
 
@Mysticial But is there an alternative that's less broken? I think a large part of the problem here is simply that C++ is a big subject, so almost nobody knows all of it equally well. There's also the simple fact that rep doesn't necessarily track very well with knowledge, especially for people too busy to answer a lot of questions.
 
drum roll please…
 
Xeo
6
A: How does the compiler know to move local variables?

XeoThere's a simple rule: If the conditions for copy elision are met (except that the variable may be function parameter), treat as rvalue. If that fails, treat as lvalue. Otherwise, treat as lvalue. §12.8 [class.copy] p32 When the criteria for elision of a copy operation are met or would be me...

 
@JerryCoffin At least I have nothing in .
 
Xeo
15
A: Is returning with `std::move` sensible in the case of multiple return statements?

XeoFor local variables, there's never the need to std::move them in the return statement, since the language actually demands that this happens automatically. §12.8 [class.copy] p32 When the criteria for elision of a copy operation are met or would be met save for the fact that the source objec...

I just noticed that those might be dupes.
 
5:48 AM
If I write some C++ (without touching things like GUI, just business code) Is it a non-trivial or extremely difficult task to get it to compile with different compilers for different platforms ? Like VC, or GNU, xcode ?
 
Xeo
@gideon No, not if you don't hack platform specific stuff into it
 
@Xeo but this applies even to business(non-GUI) code?
 
Xeo
Of course, if you use C++11, you'll gave to check for compatability with the different compilers, but other than that, it shouldn't be that difficult
(Btw, Xcode's compiler is Clang)
 
aha
oh I see. Is C++11 supported on Windows, Ubuntu and OSx?
 
Xeo
Depends on the compiler
 
5:50 AM
@gideon If you know what you're doing, you can write a lot of code that's quite portable -- but it's also pretty common to see a lot of non-portable code, especially from people who aren't very aware of portability issues.
 
I see,
But then I would have to know a lot about portability issues?
 
@gideon Yes, to varying degrees. Pretty nearly all current compilers have at least some C++11 features, but all are missing at least a few as well.
 
I see.
 
@gideon It's less a matter of knowing a lot about them, than knowing at least a little, and remaining aware of them (nearly) all the time.
 
good thing i unplugged my laptop
and theres the power surge
 
5:55 AM
@JerryCoffin I see,
 
eh, that got abit mixed up
router was restarting
 
@JerryCoffin I just was thinking of cross-platform application with native GUI options and I was considering writing a C++ "core" and then using it with native SDK's on each platform.
 
bet $10 my brother was in the middle of something (during a bad thunderstorm)
 
UPS FTW
I have like 3 of them in my room... most of the guys in my dorm have none... lol
 
@Mysticial, Sure, but I have a laptop
 
5:58 AM
I wonder if those laptop power-bricks count as surge protectors.
 
the adapters?
 
@Mysticial Yes, but. They pretty much all have fuses in them, but difficult to replace, so while it protects the laptop from a surge, you may have to replace the whole power brick..
 
@JerryCoffin hmm... good point
 
@gideon Certainly possible. You might also consider using Qt to let you write your GUI code fairly portably, and still get something that looks (at least mostly) native on each target platform. I can't say I really like Qt very well, but for certain jobs it's about the best you can get.
 
I'm basically just watching Joe Castillo right now, I can live with battery saving mode. His videos are actually pretty good.
 
6:03 AM
-1
Q: Complexity of the memset function in C

Melkhiah66I was discussing with some friends a piece of code, and we discussed about using memset function in C, which is the order in Big-O notation for this function if we initialize an array of size N?

^^ eh... seriously?
 
@JerryCoffin ah I see. Yea I'm looking at Qt also.
@JerryCoffin seems I can mix a regular C++ library into a Qt project?
 
@gideon You can, but Qt tries to supply practically everything, so most projects using it, use it for nearly everything.
 
I see.
Alright thanks so much guys, and thanks @JerryCoffin :)
 
@gideon No problem.
Well, I probably need to go get some rest. Later all.
 
@JerryCoffin night
0
Q: C++: Are multiple compilation units still worthwhile when (execution time) >>> (compile time)?

user1476176Based on my understanding, the chief benefits of creating a program with multiple compilation units are reusability of components and shorter compile times when incorporating small changes. I also think (possibly wrongly) that there is a penalty associated with this, in that functions which are ...

is that something for programmers.SE?
 
6:20 AM
Oh, before I go: I probably won't be around as much for a while -- my new baby is due for delivery (C-section) tomorrow morning. I'll be getting even less sleep, but for other reasons...
@Mysticial Looks like it to me.
 
ha, I think my comment worked. I don't see 5 different answers about premature optimization.
 
6:47 AM
There's not much I can do to make this better, is there?
And you don't need a check for empty strings when iterating through a file, right?
 
7:00 AM
-9
Q: My blog's link is flagged as being unsafe and I don't know why.

Lourdes SanchezI got my present domain 3500tvchannels.com via iPage on 4/8/12 to promote my affiliate link for a Clickbank product 'Satellite Direct'. The link that FB is showing as being unsafe is my affiliate subdomain http://flightsimulator.3500tvchannels.com/ which promotes another Clickbank product called ...

Read the comments before the question gets deleted.
@chris meh... too much C++ that I don't know is in that for me to properly judge...
 
Wow, my endeavours start well.
Out of two people so far that I've responded to their cplusplus link with the Why cplusplus is bad link, one of them thanked me.
@Mysticial, That question is getting a bit rowdy now.
 
and it's gone...
I have a screenshot of the post with the latest comment.
I tried to leave another comment myself. (a nice one) but it was gone by then
user image
4
 
7:22 AM
Well let's hear it anyway..
 
@Mysticial your screenshots are always unmistakable ^^
 
@bamboon Well duh... my UN is all over it...
 
@Mysticial ... and your fancy colored lineboxes
 
@bamboon It's worse on some of my other machines. :P
 
@Mysticial what was the reason again?
 
7:28 AM
@bamboon I got tired of seeing the same white on all 8+ of my machines.
So I have a different color on almost all my machines.
My main machine has purple. So that's what you see most of the time.
 
@Mysticial oh yeah, that is something I am doing with my IDE/Editor, too.
 
But my other machines have, blue, green, cyan, black, yellow, pink...
 
morning all
 
evening
 
I see have a good few videos to watch though :P
 
7:31 AM
red, and brown...
 
brown? ... pooo!
yes, I am that childish
 
@thecoshman Yeah, my 16-core AMD server runs a brown theme... it actually looks pretty good with Aero IMO.
 
@Mysticial is that still the machine you got from some guy over at XS?
 
@bamboon Yeah, from skycrane.
 
oooh beefy
 
7:36 AM
Sandy Bridge machine has been running a girlishly pink theme since I built it. Most of my benchmark screenies are on that machine too lol...
 
7:52 AM
namespace 'stood' o_0 does any one else actually say it like that, I've always just said the three letters, or 'standard'
 
@thecoshman wait till he talks about shared_pootrs
 
@bamboon oh lord! I thought it was a clever talk, not a comedy
he has a bit of a thing for cats :P
stdio I would have though, "standard I O" or "S T D I O", how does any one get to "studio"?
 
8:11 AM
@thecoshman probably dyslexia or similar.
 
8:28 AM
99.9k
@thecoshman same way people sometimes pronounce the "std" in std::vector as "stood". It's faster/easier to say than "ess tee dee"
 
@jalf all ready loled at 'stood'
 
10 votes in 5 min... nice. I'll make that 11
6 more and you'll need a screenie at 100k exactly
ha, actually you'll be capped at exactly 100k if you don't get the tick before then.
 
@bamboon oooh!!! he just did it
oh, brilliant, debooger
 
@thecoshman who are we talking about?
 
8:36 AM
@jalf You are really close now!! =)
 
huh, ADL is a crazy thing
 
@thecoshman Yes, I stick to the simplified rule of it
 
seems like something that for the most part, you should try to not rely on
 
The rule or ADL?
 
ADL
 
8:42 AM
ADL is great, it gives compile-time dispatch for free functions
 
... that's called lookup.
ADL is one kind of lookup, without ADL you still have lookup :|
 
Free functions are basically operators, we just need Haskell backtick syntax to get fully user-defined operators.
 
ADL just looks like something that is going to make it hard to know what function is actually going to be . of course it has its uses, but it's still a very tricky thing
 
@thecoshman How often do you make unqualified calls anyway?
 
@LucDanton I'm answering a question about recursion now, and I got a reply saying that "(note: afaik it's not specified which call goes first)." But the calls should be executed left to right? Imagine a function calling two separate functions that need to be executed in a specific order.
 
8:46 AM
rarely, I would almost always declare the namespace for the function I am calling, unless it is from with in the same namespace, but now that I understand ADL, I can see why that could still cause me problems, potentially
@ManofOneWay link
 
@ManofOneWay This is incomprehensible without context and code.
 
2
A: I am not able to understand the recursion of functions. How it works? how the values are stored and all?

Man of One WayWhen entering a function, a new stack frame is created (on the stack in memory). The stack frame keeps track of the local data within that function, such as local defined variables and incoming arguments. (And other things such as return address and previously stored register values that must be ...

 
@ManofOneWay Order is unspecified.
 
Is it because of the plus operator?
 
Yes.
 
8:48 AM
tree_size(node->left) + tree_size(node->right) btw. Yes, no ordering specified.
Ordering is only specified across sequence points: semicolon, boolean operators, comma operator, etc.
 
Thanks
 

« first day (649 days earlier)      last day (4317 days later) »