« first day (584 days earlier)      last day (4368 days later) » 

6:04 PM
Hey all, I could use your input on something
This question has been flagged:
16
Q: In which versions of the C++ standard does "(i+=10)+=10" have undefined behaviour?

aixIn C++, does the following have undefined behaviour: int i = 0; (i+=10)+=10; There was some debate about this in the comments to my answer to What's the result of += in C and C++? The subtlety here is that the default response seems to be "yes", whereas it appears that the correct answer i...

As a dupe of this one:
140
Q: Undefined Behavior and Sequence Points

Prasoon SauravWhat are "Sequence Points"? What is the relation between Undefined Behaviour and Sequence Points? I often use funny and convoluted expressions like a[++i] = i;, to make myself feel better. Why should I stop using them? If you've read this, be sure to visit the follow-up question Undefined Beha...

 
huh, codepad doesn't seem to do offsetof correctly: codepad.org/rGnAdZem
 
The question is, there's talk in the comments about updating the original to include c++11. Are you guys going to do something to update the original to include c++11? If so, then the first question can be closed.
If not, then the first question isn't a dupe.
 
3 hours ago, by Potatoswatter
@casperone is on some kind of closing/deleting rampage.
@casperOne good question. You're right that we should update the original. Thanks for the notice
 
@MooingDuck I only process a few hundred flags a day, are you suggesting I should leave the crap that I know about?
@MooingDuck Should I take this as you guys will sometime soon?
 
oh my god not the (i+=10)+=10 question again
 
6:10 PM
@stdOrgnlDave Unfortunately, yes? I just want to know if you guys are going to work on the FAQ for this point to address c++11
 
@casperOne that's a tricky one to merge and there is value in the newer answers (stackoverflow.com/questions/10655290/…)
 
@awoodland I'm not necessarily looking to merge.
 
hey guys what's the difference between *++c = 4 and *c++ = 4
(also malloc.c is entirely readable IMO, after a long time at it)
 
I can't close the first as a dupe of the second, since c++11 isn't addressed in the second. If you guys are going to update the FAQ though on this point, I'd just ask that you guys remember the first question and vote to have it closed as a dupe of the FAQ later.
 
@casperOne actually, comments make it look like updating the old one would not be the best course of action
 
6:12 PM
@casperOne They're not dupes. One of them is the most general advice, and the other is very specific- they just happen to touch on the same areas
 
Alright. It won't be closed as a dupe. Thanks.
 
@stdOrgnlDave one assigns 4 to the value after the one originally pointed at, and one assigns 4 to the value originally pointed at.
 
@MooingDuck exactly correct. pre and post increments.
 
@stdOrgnlDave oh, was it a quiz?
 
the reason (i+=10)+=10 works is the same reason if (p = new malloc()) works
 
6:16 PM
@stdOrgnlDave but with more modification in the former
 
@stdOrgnlDave That's not true at all.
 
Your mother is not true.
 
@DeadMG you're right, sorry
 
the latter doesn't matter if it's an rvalue or lvalue either
 
Xeo
@std: Back, mind posting the cmd again?
 
6:18 PM
GCC believes that this is valid and assigns i to it
++(++i)+=10;
 
Just a sanity check: and, or, not and friends were already standard core C++98, right? Like if (a and b or not c) ...
 
@xeo regsvr32 /u (whatever the name of the dll was?)
 
@stdOrgnlDave The specific behaviour of any implementation is irrelevant as to whether or not it's UB.
 
Xeo
okay
 
@DeadMG I know that.
 
6:19 PM
@stdOrgnlDave a lot of compilers compile UB
 
then why did you say it?
 
but the thing is that that is valid
 
you may as well have said "The sky is blue; therefore my code is not UB."
 
the += is a sequence point
 
@stdOrgnlDave you mean the syntax? It is valid.
 
6:19 PM
@stdOrgnlDave No it isn't.
 
"Your mother is fat; therefore my code is not UB." is a more convincing argument.
 
@stdOrgnlDave not in C++
 
There are no sequence points in C++11.
 
it may be ordered in C++11, but there is no sequence point in C++03
 
Xeo
liberal translation: "the module ... is maybe not compatible with this version of windows ... bla bla 32bit/64bit"
 
6:20 PM
wait, damnit
 
@RMartinhoFernandes Really? Then how are we going to trap noobs then?
 
Xeo
The worst is really that my network connection just won't work
everything else is fine
 
I can't explain it in words, only in code
@Xeo you reboot after that
@Xeo if it doesn't, after that reboot, do regsvr32 (dll name) and reboot
and cross your fingers, eyes, and toes
 
@stdOrgnlDave I don't see what there is to explain. It's valid syntax, but undefined behavior.
 
@MooingDuck if the difference between *++i and *i++ is defined behavior, so is the difference between ++(++i) and ++(i++)
 
6:24 PM
(assuming I know the definition of syntax correctly)
 
Xeo
Aw, screw it. I only got 1 system restoration point, and that's from today after installing windows updates after the dll got fucked up
 
xeo
did you use regsvr
 
@stdOrgnlDave The difference between the two examples is that ++ modifies its argument, but * doesn't.
 
Xeo
I tried, spewed an error that the dll is incompatible
 
hmm, breakpoints don't work so well when I forget to attach
 
6:25 PM
@xeo run the command prompt with administrator privelages
 
@stdOrgnlDave no, one modifies i twice, that's different
 
@Xeo and don't forget to fully qualify it, c:\windows\system32\rasapi32.dll or whataever
 
@stdOrgnlDave *++i and *i++ are both well defined (with differing semantics), ++(++i) is undefined behavior in C++03, and ++(i++) does not compile in any version of C++, at least not for scalar types like int.
 
@Xeo if you don't know how to run command prompt as admin, make a shortcut to cmd.exe and set it to run as administrator in properties after
I have to go yell at a furniture store
 
@FredOverflow The language should enforce that any variable named i is always of an integral type :)
 
6:29 PM
@RMartinhoFernandes C++ is not Fortran :)
 
@RMartinhoFernandes I frequently name iterators i
 
I believe even Fortran doesn't have that restriction anymore.
@MooingDuck Blasphemy!
Thou shalt name thy iterators it.
2
 
@RMartinhoFernandes for(auto i=cont.begin(); i!=cont.end(); ++i)
 
@RMartinhoFernandes I also do that.
 
@MooingDuck I prefer for (auto&& x : cont).
 
6:30 PM
@RMartinhoFernandes I usually end up with iter
 
mhm, i name only "container iterators" it. Whenever i need a dummy for loop, it's always i.
 
@RMartinhoFernandes Did you just shop that yourself?
 
There's a generator for it :)
 
@FredOverflow I present thee memegenerator.net
 
6:32 PM
Dun dun duuunnnn.
 
@FredOverflow I don't have MSVC11 yet
 
Xeo
@std: I did run the cmdline with admin, and like I said, it just spews an error about incompatability
 
@ScarletAmaranth A "dummy for loop" is for(int i = 0; i < something; ++i)?
 
@RMartinhoFernandes Wow, what a great waste of time! It doesn't support special characters like + though :(
 
@RMartinhoFernandes Oh, yea, i meant it in a way so that i don't directly manipulate some set of data.
for (int i = 0 ...) but for (auto it = std::begin(vec), std::end(vec), ++it) { do this to each element }
Or i just pass a lambda to foreach or something, whatever tickles my fancy in that particular moment.
 
6:37 PM
I don't use three-legged for loops anymore :P
 
o_O
for (int i = 0; i < whatever; ++i) { std::cout<<"mhm"; } how would you replace this ?
 
@ScarletAmaranth I rarely need to loop from 0 to something.
 
sbi
Hey, Andy Koenig changed his twiiter avatar. @Tony should like this
 
Like in Python, all you need is the range-based for loop.
 
sbi
6:38 PM
> I think fire drills exist just to make sure us geeks actually step outside at least once every few months — Jared Parson
 
It's a caaaaaat.
 
Why would @Tony be interested in that?
There are no boobs in sight.
 
Oh, hello @sbi.
 
sbi
@EtiennedeMartel Yeah. A bit oversized, really, so I un-oneboxed it.
@RMartinhoFernandes Because he seems to have a certain affinity for cats?!
 
@sbi hmm, I cannot click the "this" link, due to the SO buttons on the edge.
 
sbi
6:40 PM
Hi,@Etienne!
 
Who doesn't have an affinity for cats?
 
@MooingDuck Buy a bigger screen?
@EtiennedeMartel Dogs.
 
@EtiennedeMartel DeadMB possibly
 
That's it, I'm calling him DeadMB from now on.
3
 
sbi
@MooingDuck Ctrl+ in FF.
 
6:41 PM
@RMartinhoFernandes I'm busy working, I can't possibly be expected to think
 
I've come back to apologize for trolling just now
 
Yeah, riiiight.
 
sbi
@stdOrgnlDave Thanks. Now please go back to where you came from.
 
@MooingDuck how small is your window?!
 
6:42 PM
Damn.
 
@RMartinhoFernandes did @sbi hurt your feelings? not very nice of him :-( wait do robots even have feelings?
 
sbi
@EtiennedeMartel Me. I merely tolerate them. (As opposed to dogs. I can't stand those.)
 
@RMartinhoFernandes shouldn't that be "I calculate that that would produce an ow."
 
Nah, I tripped and hurt my knee.
:P
 
so robots do feel things
other than extreme hatred for the human race
 
6:44 PM
What you call pain is a safety mechanism.
 
@RadekdaknokSlupik about a quarter of my screen so coworkers are less likely to notice
 
That said, I don't think @sbi likes @stdOrgnlDave.
 
is the hatred also a safety mechanism?
 
What hatred?
 
@MooingDuck that's smart.
 
Xeo
6:44 PM
Ah, screw this... time to reinstall windows :(
 
@RadekdaknokSlupik also why my response times are high unless pinged
 
@RMartinhoFernandes if not for hatred, why are you going to destroy the human race?
 
@stdOrgnlDave That's a goal, no hard feelings involved.
 
sbi
@stdOrgnlDave Don't feel yourself elevated. I wouldn't spare a feeling as precious as hatred for you.
 
@EtiennedeMartel thanks I noticed
@sbi wow OK what did I do to deserve that? a little innocent trolling about ++(i++) gets people thinking :-(
 
6:45 PM
I have no idea who is being trolled right now.
 
@sbi's trolling. With a killsat.
 
Xeo
So, a full backup of the registry is probably not all that helpful, right?
 
@RMartinhoFernandes could you have inherited the feelings from your creators, or are you a consequence of them only?
 
GAH Why is code that I commented out still executing?
 
@MooingDuck you need to do a clean build
 
6:46 PM
@MooingDuck Not saved?
Saved wrong file?
 
sbi
@stdOrgnlDave I hadn't even known you were trolling about that, but every time I come here and you are around I verge at the edge of plonking you. And that edge is a very unfitting place to hang out at.
 
Ran wrong file?
 
@RMartinhoFernandes MSVC auto saves
 
@sbi plonking?
 
@stdOrgnlDave clean build takes forever :/ Even incremental builds take long enough to bore me
 
sbi
6:47 PM
@stdOrgnlDave lmgtfy
 
Xeo
The worst about reinstalling windows is to reconfigure everything
 
Plonk is a Usenet jargon term for adding a particular poster to one's kill file such that the poster's future postings are completely ignored. It was first used in 1989, and by 1994 was a commonly used term on Usenet regarding kill file additions. The word is an example of onomatopoeia, intended to humorously represent the supposed sound of the user hitting the bottom of the kill file (imagining perhaps the kill file as a bucket). It is also sometimes given as an acronym standing for Please Log Off, Net Kook, though this is likely a backronym. Other used expressions are "put lamer on kill...
There's also this:
Plonk is an unspecific and derogatory term in British and Australian English for wine that is notably inexpensive or judged to be of poor quality. It is believed to come from Australian slang, in reference to blanc (the French word for "white"), before it became naturalised in Britain. Stereotypical examples of plonk in the British context would include Blue Nun or Liebfraumilch, both sweet German wines, although Spanish wine is often also a target. Despite the reference to the colour white, the term is not limited to white wine, and can as easily indicate a red wine or rosé. Plonk that i...
 
@stdOrgnlDave oh, rebuilds were failing because it's debugging itself. Of course.
 
That's never a program on Linux!
 
sbi
@RMartinhoFernandes Oh, I just love that fish. I should henceforth use that to express my disgust to some douche bag.
 
6:49 PM
I am trying to write R<T*>::const_iterator it; but it tells me const_iterator is not a member of global namespace. do i need to put std::` somewhere ?
 
Needs more cowbell typename?
 
how do you mean ?
 
Ooh, you don't know? Get ready for getting annoyed... fishing link
 
@sbi well, I deserve that. but you're not around much (when I am), there's also times where I'm extremely helpful and kind. considering the comparatively small number of times we've been around at the same time it's entirely possible and plausible that you've happened to be around for crappy ones instead of good ones simply by chance
 
75
Q: Where and why do I have to put the "template" and "typename" keywords?

MSaltersIn templates, where and why do I have to put typename and template on dependent names? What exactly are dependent names anyway? I have the following code: template <typename T, typename Tail> // Tail will be a UnionNode too. struct UnionNode : public Tail { // ... template<typen...

 
6:50 PM
yeah, he needs typename
 
If R or T are template parameters, you need typename R<T*>::const_iterator. All the nasty details in the link I posted.
 
Xeo
300mb full registry backup... that's not as much as I anticipated
 
tl;dr long story short the template doesn't know the types of some things sometimes during instantiation and you can be explicit by putting typename in
 
who invented this thing
 
I warned you ("Get ready for getting annoyed").
 
6:52 PM
i didnt imagine c++ would be orders of magnitude more complex than C
 
Xeo
@Michael just FYI, compiler devs are very grateful everytime they do not have to do tentative / guessed parsing
 
sbi
@stdOrgnlDave Well, that sounds pretty genuine. I shall try to have an unbiased view onto you then one more time.
 
@Xeo C++ compiler devs are something special i guess
 
Xeo
A bit of inconvenience on our side for a speedup during compilation. Not a bad deal, right?
 
sbi
6:54 PM
@Michael The C++ Standardization Committee's Language Working Group, I'd guess.
 
With a little help from dmr (if you take "help" to mean "guilt").
 
@sbi helpful and nice he is, he just debates very strongly, which some people take offense to.
 
sbi
@Michael Actually, C++ is orders of magnitudes of orders of magnitudes more complex than C++.
 
@MooingDuck woof woof
 
Xeo
lol
 
6:55 PM
@sbi thank you.
 
@sbi Sounds like Hofstadter's Law
 
@DeadMG that wasn't to you
 
:)
 
Xeo
@sbi sure you didn't make a typo there?
 
6:56 PM
@MooingDuck I think he was alluding to our fun time yesterday :-P
 
sbi
@Xeo :D
 
@Xeo What you think is a typo is the actually gist of the message.
 
why oh why did I have to wake up so early today
I want to sleepsies
 
it's too early
I'll wake up at like, 4-5 am
 
6:56 PM
@RMartinhoFernandes what created you?
 
@DeadMG So? Keep going until you turn around.
What? No. I came into existence by my own volition.
 
sbi
@MooingDuck Never mind the puppy wagging his tail. He does this every time someone looks at him.
 
@RMartinhoFernandes what other goals than the destruction of humanity do you have?
 
Xeo
@RMartinho: Just wanted to make sure :P
 
@RMartinhoFernandes Easier to go from 7am->11am than 7am-4am-1am-11pm-8pm-5pm-2pm-11am
 
6:58 PM
@stdOrgnlDave Keeping humanity from discovering I plan to destroy them.
Wait, something's not right here.
 
your grammar?
:P
 
sbi
@stdOrgnlDave Wouldn't one Quixotic goal be enough?
 
Xeo
Man, I don't want to reinstall windows...
 
@RMartinhoFernandes I think we already know.
 
@Xeo Then install Linux.
 
6:59 PM
Why do you pronounce Quixotic?
 
kwikˈsätik
 
Exotic. But with quick in front of it.
 
@Xeo if you don't want to reinstall windows, go back to what @johnathon said earlier and follow his advice
 
sbi
@EtiennedeMartel Yeah, it's one of his deficiencies: he can't help but has to brag about it, and thus spoils it all.
 
Xeo
6:59 PM
xotic, not toxic
 
@sbi I don't think he'll be very efficient. Maybe that's why we keep him around.
 

« first day (584 days earlier)      last day (4368 days later) »