« first day (90 days earlier)      last day (4850 days later) » 

12:02 AM
@AlfPSteinbach indeed, why downvote? something that is wrong yet contributes to the discussion might be worth an upvote!
upvotes mean "useful", not "correct", though there is, of course, significant overlap :)
@sbi incidentally, the core of that question must be one of the most misunderstood quotes in computing
 
@FredNurk great answer, +1 from me :)
@FredNurk kinda reminds me of Kant in Critique of Pure Reason.
 
I'm unfamiliar, will have to look it up
 
I read it at one point, but I Kant remember what he said in it.
 
lol
 
@JamesMcNellis I should've said Kritik der reinen Vernunft, I suppose :P
 
12:12 AM
@FredNurk i'm getting quite mixed signals on when and when not to downvote.
 
@Alf: it seems there's widespread disagreement, as for any non-trivial issue in a community :) I've been tempted to downvote, but I haven't, yet
 
You can always use your own criteria... for example, you could upvote any post made by a person with a username starting with the letter J and downvote any other post.
 
I'd recommend anyone try going a month without downvoting
 
oh, please, follow @JamesMcNellis's advice.
2
 
maybe it's just an issue of scope: I feel no need (after many years in public forums) to "protect" other users from incorrect information by "downvoting it into oblivion" or such. if it's distracting (such as completely ignoring the question or being commercial advertisement), then it should be completely removed rather than left at a low score
 
12:19 AM
I generally only down-vote if the answer has clearly strayed from the point of the original question, or is so factually wrong that it induces seizures.
 
@JamesMcNellis :-)
 
I generally avoid downvoting when the post has already been downvoted to the point of being explicit it's not a good answer/question. But if the poster tries to convince people otherwise, I unmercifully downvote.
 
(and yes, I've sometimes misinterpreted a question and given a retarded answer and if I could downvote myself, I would)
 
hi, i'm sorry for question. i can here ask question and discus it?
 
shoot, Ferz
 
12:22 AM
@ferz you always can, but you might not get an answer. Try, and observe. Hopefully people will answer or ask you to post it at SO.
 
?
why the types of different sizes on different hardware
 
@ferz please give a concrete example
 
instance on 32 bit system int 4 bytes, on 16 bit system 2 bytes(though I figure I can mix up)
but princeples is the same
 
@MooJuice the solution there is easy: delete :)
 
@ferz because int tends to be the defined by the size of the architecture in question. 32 bits are equivalent to 4 bytes, and 16 bits are equivalent to 2 bytes. The simple math is 1 byte = 8 bits (normally). But this isn't always true. For instance, int is still 4 bytes in 64 bits architectures.
 
12:33 AM
but not all 64 bit implementations: some do things differently when targeting the exact same machine
@ferz: it was simply a design choice of early C that the basic integer types had minimum required ranges without being completely fixed
it was much more common to have vastly different types of systems back then, and that choice made much more sense than it does today
though I recall early-early C wasn't that way, it was late-early C, but, clearly, I only say this to induce confusion that prompts you to go read about C history :)
 
thanks
i have more question
 
i go out for five hours and there are 474 messages waiting
this place is hot, man
 
meh, that's less than 100/hr
 
@ferz you also might be interested in exact-width integer types - see stdint.
 
it's too bad the least-N stdint types are so clumsy
 
12:46 AM
@FredNurk in what sense? naming?
 
@Fred oh is that all
seriously, how do I stop this frakking feed from popping up, requiring me to press 'dismiss' every few minutes
 
though I suppose that's really hard to do in C's or C++'s type system, you can't have int f(int) which expresses that given an int of at least N bits, returns an int that fits in no more than N bits, so, in C++ at least, you resort to templates-as-panacea, which fails on anything in this vein that's even slightly more complex
 
it's vaguely useful, but if I'm already freshing the Questions page elsewhere it's just bloody irritating
 
@TomalakGeretkal: file a feature request and get it implemented (not easy for this, I imagine)
 
@Fred: So it's not currently possible?
 
12:48 AM
something someone somewhere requested that was somewhat similar got declined
 
You guys seriously sit here all day and repeatedly press 'Dismiss'?
 
@TomalakGeretkal: not without completely removing the feed for everyone
 
I won't apologise for that fact that I think that is completely and utterly retarded
and I don't even like that word
 
no, I let it scroll and click dismiss only when it gets in the way of chat history :)
 
ridiculous
almost everything else about the SO software is so intelligent. this is quite a disappointment.
 
12:51 AM
@TomalakGeretkal Install a browser extension that allow you to inject JS code, then overwrite the damn timer period to infinite. Okay, I'm kidding.
 
I don't know why you are kidding... I have a user script to remove the "x" buttons next to the favorite tags entries on the SO homepage. I kept removing tags accidentally because I'm incapable of using a mouse successfully.
 
@TomalakGeretkal using the interface more will disabuse you of that
 
@JamesMcNellis gah! too much work. I'm lazy.
 
Nah. I asked on meta and got someone else to write it. I just had to install it.
2
 
@Fred: That's great. Use it enough and you'll get used to its stupidity.
 
12:53 AM
@JamesMcNellis wow! That deserves a star. The art of delegating.
 
Only a Facebook developer would design with that philosophy in mind; I certainly hope that it's not deliberate here.
@James Losing the ability, in 2011, to successfully use a mouse is -- although the geeks think it's cool -- very far from.
Meanwhile, I'm 8 points off 1,200 rep and appear to have capped out for the night. How very disappointing.
 
Mouses serve no purpose other than gaming. And of course, browsing bad-designed websites.
2
 
Wow. Just... wow.
It's like you all want to pretend that you were alive in the 80s!
Best of luck with that.
 
@TomalakGeretkal seriously, I have 10 fingers on my hands, don't you?
 
12:59 AM
@jweyrich Nope. I have fingers on my hands, but not in them.
 
@TomalakGeretkal quickly solved that mistake. Thanks for teaching me english. I appreciate as it isn't my primary language.
 
@jweyrich Happy to help. :)
Gods this feed popup is right pissing me off
ARGH
 
@TomalakGeretkal I'm always confused about IN and ON. I should stop and study about it at some point.
 
@TomalakGeretkal ... I was alive in the 80s
 
@jweyrich To be fair, I sympathize.
@FredNurk I imagine most of us were. I think I was joking.
 
1:03 AM
I meant alive in the sense of using computers daily, not just breathing :)
 
@FredNurk Yes, I got that.
Sorry, I am in IRC mode.
It involves an element of knobheadism.
 
@FredNurk hrmm. I'm kinda new to these toys.
 
@TomalakGeretkal good ol' freenode
 
@FredNurk Innit tho?
@FredNurk Are you present?
 
nope, I'm about to go out
 
1:08 AM
I don't mean right now, gees. I mean in general.
 
not often currently
 
Nick in ##c++?
 
1:43 AM
whoo, finally made 1,200
 
@Tomala what this 1.200?
 
@ferz No, "1,200".
 
@Tomala what is 1,200?
good night all, thank with answer.
 
Rep
0
A: what does ::operator() do?

Tomalak Geret'kalYou're trying to call a free function operator() on a void*. To the best of my knowledge, this does not exist. Hence, it does not compile for you. I would offer alternative suggestions if I had any idea whatsoever about what you're attempting to accomplish here.

What the fuck is with all the downvotes here?
 
2:06 AM
@TomalakGeretkal Just the usual anonymous drive-by downvoters. Assume they're kids.
 
@AlfPSteinbach Oh that's already done, don't you worry. :)
3
Q: Memory allocation patterns in C++

MahatmaI am confused about the memory allocation in C++ in terms of the memory areas such as Const data area, Stack, Heap, Freestore, Heap and Global/Static area. I would like to understand the memory allocation pattern in the following snippet. Can anyone help me to understand this. If there any thing ...

Liking this question.
 
Hm, I would amend the answer a little. Removing reference to "stupid people". Also, the terms are not particularly outmoded, they're just a little imprecise (with multiple meanings).
 
They are outmoded.
 
Also, please note that where you refer to "these data structures" you invoke a misleading connotation, namely the data structure called a "heap" -- which has nothing to do with the heap/heaps for dynamic allocaiton.
 
That they are imprecise is covered.
@AlfPSteinbach No, that's exactly the point of the answer!
What I am saying is that the data structure "heap" has nothing to do with the dynamic storage area.
 
2:11 AM
I think what you write here now is a good formulation. :-)
 
However, <<The terms "heap" and "stack" are outdated, relating to back when the most popular runtime libraries used these data structures to store objects which were dynamically- and automatically-allocated, respectively (statically-allocated objects fit into neither category, incidentally).>> is IMO ungood formulation.
 
@AlfPSteinbach I think it sums the situation up pretty well. Can you be more specific about how you disagree with it?
 
That's because the referent of "these data structures" is unclear.
A heap for dynamic allocation is no particular data structure, so it's easy to misinterpret the above as referring to the data structure called a "heap".
 
"These data structures" refers to "heap" and "stack" introduced at the start of the sentence.
That's not a misinterpretation, Alf. That's the exact intention of meaning.
You are agreeing with me 100% and not realising it. :)
 
2:15 AM
OK. just reporting how I read it. ;-)
 
2:27 AM
can anyone mention how to overcome buffer overrun in vc++
 
@Lakshmi: The debugger is very useful
@Lakshmi: Without more information it's hard to recommend much else
 
I can't remember the last time I had a buffer overflow in a (new, non-legacy) C++ program.
 
@JamesMcNellis I'm all out of medals
 
Starring my posts only encourages me to talk more. I don't think anyone really wants that ;-) There's enough sarcasm around here!
 
@JamesMcNellis Too true. Which of your posts did I star, remind me?
 
2:31 AM
No idea; it doesn't say who voted for what.
 
@JamesMcNellis Aha! Well there you go then. :)
 
2:44 AM
I'm thinking seriously of asking some basic question, finding an incorrect answer, noting as a comment that it doesn't work and I know why, voting it up, and selecting it as the solution. stackoverflow.com/questions/4686193/…
 
@AlfPSteinbach As if we needed any more evidence that you are a troll.
I appreciate the confirmation, mind you.
 
He he. No, seriously. It seems to be what people pass the time doing here.
 
Speak for yourself, dude. Speak for yourself.
 
I did.
By the way, speaking of that which you mentioned, your changing "stupid people" to "silly people" was good change, but even better, I think, just remove that ref.
 
I will only go so far ;P
"Silly", I think, is sufficiently non-abusive. It still mildly indicates my opinion that people using those terms "stack" and "heap" are out of their frakking minds.
 
3:00 AM
Well, I would have got a lot of heat for that. Different expectations, I guess.
 
You get heat for posting incorrect answers and being arrogant about it. Slightly different!
Night
 
The "ignore" button worked.
 
4:00 AM
whoo, 1,300
 
hi
 
4:33 AM
@TomalakGeretkal arbitrary points are overrated
 
5:26 AM
@TomalakGeretkal saying "Heap" and "stack" are outmoded, inaccurate and confusing terms relating to storage duration. at the start of the answer looks like you are saying std::stack and std::make_heap are outmoded
it's not like I'm reading it as that, but it seems some users do
 
I had a nightmare last night; it was 2038 and I was still explaining that arrays aren't pointers
2
 
5:47 AM
lol
 
@FredNurk Isn't 2038 when the old C time breaks down?
 
i think it's some time in 2038
maybe he was dreaming to fix the clocks and explaining his coworker arrays+pointers in a hurry?
 
6:45 AM
@FredOverflow I just watched the video; it was interesting; not a whole lot of new information, but listening to experts banter about programming languages is fun.
 
@AlfPSteinbach signed 32-bit unix time, yes
 
7:30 AM
We should get a "Close Question because it exposes the author as a cargo cult developer" option
How many times do we have to see some variant of: "I cast some parameter to the type the error message said it needed, and now the program does not work correctly - what did I do wrong?"
Why do new windows developers find it so hard to resist casting any kind of function pointer, or string pointer.
 
because they're indoctrinated to do things that way
 
8:17 AM
@JamesMcNellis I think for a C++ video, it was offtopic way too often :(
 
 
2 hours later…
10:16 AM
@JohannesSchaublitb I see! Can't really help that. My use of quotation marks makes it completely unambiguous that I am talking about those terms, as written.
Ironically, that people could mistake them for std::stack and std::make_heap is a perfect example of one of the problems with the terms.
 
@TomalakGeretkal Which terms are you referring to?
 
@KonradRudolph Please see the message to which I was replying. :)
 
@TomalakGeretkal There is no backwards arrow on your message …
 
sbi
@KonradRudolph No, but on the one before that.
 
@sbi Oh that was too long ago ;-)
I’m still getting the hang of this chat thingie
 
10:25 AM
What @sbi said :)
The terms "heap" and "stack" for storage locations
good grief
someone's been busy
-3
A: Why assign a return value to a reference ?

Alf P. SteinbachWith std::string GetPath(const std::string& top); the usage std::string& f = GetPath(cw); is invalid in standard C++ (Visual C++ may incorrectly accept it), and the usage const std::string& f = GetPath(cw); is stupid. "Why would one use a reference here"? Stupidity. Incompet...

 
sbi
@TomalakGeretkal I just spend my daily amount of flagging votes on that "conversation". (Is there anything on this site that's not guarded and limited?)
 
is there a cross-platform way to print an unsigned long long with printf?
*nix uses %llu, windows I64u, but is there one that works for both?
 
/me stabs microsoft
 
sbi
@marcog Why? Are they responsible for making things cross-platform?
 
10:40 AM
@sbi Someone's been asking why %llu wasn't working, turned out he was using windows and i just got curious
 
@sbi They're irresponsible for not doing so.
:P
 
oh, i misread "they" :P
 
1
Q: Complex number printing program malfunctioning.

fahadHi all! I have started working on C++ language.I am very new to it.The program takes a complex number from the user and prints it out.But its giving me many errors like, prog.cpp: In function ‘int main()’: prog.cpp:26: error: ‘GetReal’ was not declared in this scope prog.cpp:26: error: ‘SetReal’...

ohgod
 
lol @AlfPSteinbach i upvoted your stupid&incompetence answer
 
I’ve finally run some tests regarding RVO vs. NRVO
 
10:47 AM
@JohannesSchaublitb url
 
19 mins ago, by Tomalak Geret'kal
-3
A: Why assign a return value to a reference ?

Alf P. SteinbachWith std::string GetPath(const std::string& top); the usage std::string& f = GetPath(cw); is invalid in standard C++ (Visual C++ may incorrectly accept it), and the usage const std::string& f = GetPath(cw); is stupid. "Why would one use a reference here"? Stupidity. Incompet...

 
Why on earth would you upvote that?
 
It doesn't actually say anything, other than that the ref-to-non-const binding is invalid. It says nothing useful about the ref-to-const, then gets abusive and ignorant
 
i think there's some truth in it. i don't think it's insulting anyone
@TomalakGeretkal ohhh
 
10:49 AM
"Why would one use a reference here"? Stupidity. Incompetence. That's it, really. is completely false, so that's reason enough alone
 
right! damn :( i shouldn't have upvoted :/
 
related question:
6
Q: prolonging the lifetime of temporaries

FredOverflowWhat is the design rationale behind allowing this const Foo& a = function_returning_Foo_by_value(); but not this Foo& a = function_returning_Foo_by_value(); ? What could possible go wrong in the second line (which would not already go wrong in the first line)?

 
sbi
15 hours ago, by sbi
@DeadMG 'course you can! Make a dummy edit, explaining why you do this, and change your vote.
 
10:50 AM
it can make an observable difference though in c++0x
a type that is neither movable nor copyable by the context of initialization could still use the const-ref way but will fail with the non-ref way
e.g struct A { private: A(A const&) { ... } public: A f() { return A(); } }; A a = A().f(); // invalid A const& a = A().f(); // valid
 
Ok, so the compiler at codepad.org is really badly suited to demonstrate NRVO :p
 
darn. why doesn't it want to show the preview of a deleted answer, if the link was sent by a 10k guy?
 
@JohannesSchaublitb Because not all chat users have that much rep.
potentially
ok, so can somebody explain to me why codepad.org uses the -fno-elide-constructors flag?
 
i could make a screenshot and then paste it, then those users could see it anyway
but i won't. i'm a lazy one
 
12 hours ago, by sbi
@KonradRudolph @Charles So from reading this I understand: 1. NRVO actually never existed, because it was only a proposal meant to support compilers, which, as it seemed at the time, wouldn't need that support. 2. RVO actually was implemented, first by Zortec, then by cfront, and only 2003 by MS. (Confusingly, Stan later refers to RVO as NRVO, which likely indicates that I misunderstood.) 3. Even by 2005, VC seriously failed to apply RVO even for a very simple test case, making one superfluous copy.
@sbi To answer your question better late than never:
(copy & compile on your own system, codepad explicitly prohibits copy elision and thus RVO)
 
11:07 AM
-3
A: Why assign a return value to a reference ?

peenutOk, it's completely pointless. And looks awful. And not valid c++. Just don't do it. Edit: for better understanding of what I mean reference & var = funcNotReturningReference(); //invalid C++ const reference & cvar = funcNotReturningReference(); //silly C++, no saving costs (reference t...

<--- awesome
0
A: Casting to int or float depending on is_integer

Tomalak Geret'kalTry using integral promotion: os << +t; You'll get an int out of it for an integral type, or your original floating-point type if it was one.

come on, people. this is a good answer.
 
@TomalakGeretkal It is, except for the fact that this code is too obscure to be used in the wild. Encapsulated in a function though, it rocks.
(I was unsure that it would work so I didn’t upvote until I tried it)
 
I'm not sure that it's obscure.
Encapsulating it in a function seems like code bloat.
(Though I'd probably want a small comment alongside its use)
 
11:22 AM
@TomalakGeretkal See, a comment is worse bloat (IMHO) than a properly named function.
anyway
I got this interesting conversation going:
Q (me): Why are you using 1 and 0 instead of true and false?
A: that's just how i write. cheers
wtf?
 
o.o
lol
dammit
that return value const reference question? I only just fucking noticed that the author did in fact specify that the function "returns a string". All of my answers and comments have been based on the principle that you don't know what is being returned at all.
(that said, I still don't trust "returns a string" from that guy as a reliable and accurate technical statement)
 
@tina It’s midday where I am ;)
 
@TomalakGeretkal, happens to the best of us.
 
@MooJuice Yes I know! For example, it just happened to me! :D
 
@TomalakGeretkal Uh … your deleted answer explicitly mentions string copying though ;)
 
11:29 AM
@TomalakGeretkal even the standard uses the phrase "returns T" to include "T&" sometimes (but with clarifying text)
 
So this is the infamous thread from last night.
 
"For direct-initialization, those "explicit conversion functions that are not hidden within S and yield type T or a type that can be converted to type T with a qualification conversion (4.4) are also candidate functions. ... Conversion functions that return “reference to cv2 X” return lvalues or xvalues, depending on the type of reference, of type “cv2 X” and are therefore considered to yield X for this process of selecting candidate functions."
 
@KonradRudolph No it doesn't
@KonradRudolph It explicitly talks only about returning by reference. That's why I deleted it!
@JohannesSchaublitb There you go then :)
@MooJuice Yes.
 
still has normative text clarifying it. i think the same or the opposite (clarifying non-refs only) should be done by the questioner. i'll see where it goes
 
that's ok
I don't care any more than that :D
 
11:35 AM
You know, it doesn't matter how right, or intelligent someone is there is never any reason t be a prick. And there are plenty of geniuses out there who are not pricks. Those that consider themselves above others due to their knowledge (however rightly or wrongly) have severe socialogical and psychological issues, imho.
 
whoo, broke 1,400 :D
@MooJuice I agree
 
So don't be surprised if Alf has kids tied up in his basement.
 
ahaha
I've seen his profile photo. I already would not be surprised.
or was that mean
 
eh, I thought about it.
 
high five
 
11:36 AM
It's where I got the idea that he might be a serial killer from.
:)
 
@TomalakGeretkal Your last sentence in that answer reads “ You probably don't want to copy all the characters in the string needlessly.”
 
hmm somehow I think it's 3am in the night. but it's 12am in the midday!
 
That's the wonder of the internet, Johannes. Nobody knows when to go to fucking sleep anymore :)
 
@MooJuice Try to explain that to German legislation. They want to force porn sites to be only available during the night time. (Same for adult TV streams). Big lulz was had by all.
 
So, available 24/7 then?
Go-go Germany!
 
11:44 AM
@KonradRudolph So? That's relating to what would happen if you did not bind the result to a reference. The entire answer is still about the function returning a reference.
 
@TomalakGeretkal Duh. Now I understood what you mean.
 
@JohannesSchaublitb 12am is midnight! ("pm" starts at 12:00. Yes, it's broken.)
@KonradRudolph :)
 
by the way, do the sound notifications work for you people? I’m getting nothing.
 
I see the popup from my taskbar.
but my work-computer has no sounds
 
11:49 AM
Why do I get so many shitty C# developers applying for my role? None of the last 4 candidates I have interviewed can actually code.
 
and I still want to turn off this feed!
 
not for my role.. the role I have advertised, that is,.
 
@MooJuice Maybe the universe is trying to tell you something about your role
d'oh
nm then :P
 
Hey you're in Nottingham. This company is in Market Harborough. Come work for me :P
 
ehehe
You had me at "C#"
 
11:50 AM
@MooJuice Were your requirements specific? Or more in the area of “requirements: … eh. Clothes would be nice”
 
Or, rather, didn't have me.
lol
 
@TomalakGeretkal, I prefer C++ myself (that's the main area), but didn't have much choice with this one.
@KonradRudolph, let's put it this way, of the last 4 candidates I have interviewed (who had C++ and C# on their CVS):
One new what LINQ was. None new the difference between an abstract class and an interface. All had no idea about generics, nobody knew what a design pattern was..
Where the hell are the programmers around here?
 
wow
that's so fail
 
@MooJuice what’s the pay? Where do I apply? :D
 
even I know that stuff
 
11:52 AM
@Konrad, eh it's only 23k (GBP). I'm aiming for someone who can code, but who has just started out.
Someone I can shove crappy jobs on to :)
 
@MooJuice s/new/knew/
 
lol
 
ty FredO :)
 
@MooJuice I do not know C# and, while I'm confident I could pick it up and become competent in it fucking fast (:D), I wouldn't want to
What's the difference between an abstract class and an interface?
 
@MooJuice you can edit stuff for 5 minutes, you know...
 
11:53 AM
I suppose technically speaking, an interface is strictly an abstract class with no data members or function definitions
 
interfaces can't have datamembers or default function implementations
interfaces can be inherited multiply
 
I put an ad on totaljobs.com and have had every single person who livesin Karachi send their CV in.
 
C++ itself doesn't define any such requirement
 
whereas you can only inherit from one class, abstract or not
 
But I can see how society might
 
11:54 AM
that's for C#, by the way
 
@FredOverflow, thanks for the info :)
 
well, ok
Does C# define it?
 
yes
 
Aha!
How ew
MAybe
 
yeah, I know what you mean
 
11:55 AM
Actually that sounds quite good
 
no it doesn't
virtual inheritance is my choice and it's Bad™ that the language designers want to tell me that they don't like it
 
@TomalakGeretkal Alf is moderator of comp.lang.c++.moderated, I think. maybe he has been infected by some of the insults he came across in the moderation queue
 
Stop complaining, and finish writing DeadMG++.
:)
 
lol
 
11:56 AM
but I need lunch? :P
 
The fact that you need a moderated comp.lang.C++ suggests the nice-guy-to-prick ratio in there must be like 3/875
 
@JohannesSchaublitb lol
@MooJuice lol
 
oh
also
I've been thinking about the whole, iterator vs range, thing
and I think it's horseshit
we don't argue about how to pack multiple arguments to int sum(), because you just pass two parameters
why don't we just allow multiple return values?
it seems insane to me that we can pass multiple values but not return them
 
could be quite nice.
 
@DeadMG I don’t follow … how does this relate to iterators vs. ranges?
 
12:03 PM
Would you return them as an associative array, or just a plain-old array of some kind?
 
multiple function inputs, multiple function outputs
makes sense
 
Maybe we could have disinheritance too :)
 
sbi
@JohannesSchaublitb I've seen him getting caught up in "heated discussions" on clc++(m?) years ago. In fact, when he was nominated moderator, I was surprised and thought I must have messed up his name with someone else's. Now I know I was right. :)
2
@MooJuice No, but it limits the volume (try to read clc++, if you dare) and cuts out the noise.
 
i'm refreshing SO more often than FB nowadays (largely because I never seem to get my email notifications)
damn you litb
 
12:14 PM
@TomalakGeretkal Email notifications only come once a day
 
Konrad
it relates to iterators vs ranges because if you had multiple return values
you could just return multiple iterators
thereby instantly negating the necessity of ranges
 
@KonradRudolph Once a never in my case
 
12:26 PM
i think @Alf is a good mod on those lists. I've seen some nice mod comments on the list
@TomalakGeretkal what's up?
why did you damn me lol
 
@DeadMG related question:
10
Q: What is the status of ranges in C++?

FredOverflowSometimes I get tired of all this my_vector.begin(), my_vector.end() noise. Last year at boostcon, Andrei Alexandrescu's keynote speech was titled Iterators Must Go (video) Is there any progress on introducing ranges into C++, so I can finally say std::sort(my_vector)?

 
sbi
@JohannesSchaublitb Yes, he is. But once in a while...
 
@JohannesSchaublitb For getting me into SO
 
lol @TomalakGeretkal .
 
@TomalakGeretkal, I spend more time on SO than I do on reddit/FB combined.
 
12:48 PM
argh
most irritating thing ever
1
A: O my Lambda!!!!

DeadMGThe return type of the ?: operator has to be deduced from it's two operands, and the rules for determining this type are quite complex. Lambdas don't satisfy them because they can't be converted to each other. So when the compiler tries to work out what the result of that ?: is, then there can't ...

Why doesn't my code compile? Ok, fair enough
but no wait, because I'm the guy who posted the original question, you MUST ANSWER MY FOLLOWUP QUESTION.
no, I really don't
 
@DeadMG "There is nothing..." tends to ask strange questions.
 
there's nothing wrong with the original question
what irritated me was that he then posted a followup in a comment asking me something completely out of the scope of the original
and acted all mighty because he posted the original question
 
@DeadMG But nobody would actually write code like that, right?
 
of course not
it fails to compile because he forgot to call the lambdas he defined
that's pretty much it
you could I guess use it in combination with a std::function
std::function<void()> arg = var ? [](){} : [](){};
but Istill think that would be ill-formed
 
@DeadMG Funny, I just made a comment about std::function on your answer :)
 
12:54 PM
indeed
I saw it
 
0
A: Draw a line in mfc with help of toolbar

Moo-JuiceOk, you're going to have to override several member functions to do this. I've outlined an approach below. My example below deals with a single line-drawing operation (from mouse down, to mouse up). An exercise for you, is to make it so that once you've done one, you can then do another at a d...

 
and now I'm going to rip it to shreds :D
 
I think I went overboard on this answer...
and forgot to check the MFC reference, lol
yup, I had the params wrong to those functions.
 
@DeadMG fair enough :)
 
I think that ?: is really quite pointless
 
12:59 PM
@DeadMG related:
30
Q: Is the ternary operator evil?

FredOverflowFor example, would you prefer this one-liner int median(int a, int b, int c) { return (a<b) ? (b<c) ? b : (a<c) ? c : a : (a<c) ? a : (b<c) ? c : b; } or an if/else solution involving multiple return statements? When is ?: appropriate, and when is it not? Should it be taugh...

 

« first day (90 days earlier)      last day (4850 days later) »