Forums before death by AOL, social media and spammers... "We can't have nice things"
|    comp.lang.c++.moderated    |    Moderated discussion of C++ superhackery    |    33,346 messages    |
[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]
|    Message 31,657 of 33,346    |
|    Carlos Moreno to Joshua Maurice    |
|    Re: Reference to show that if (this == N    |
|    09 Nov 11 13:17:54    |
      5fb96358       From: moreno_news@mailinator.com              On 11-11-09 01:31 AM, Joshua Maurice wrote:              >> Wait a second --- notice that I said I'm trying to convince       >> someone that the trick invokes undefined behaviour; but the       >> thing is, his argument is that he got the idea from C++ books       >> (not sure which one(s), as I don't recall seeing the technique       >> in books),       >       > Those are some mighty bad C++ books then. Unfortunately, bad C++ books       > do exist.              *sigh* tell me about it (long story --- suffice it to say that       the poor quality of books, and even when only seen as the       *educational* quality of books, has been a pet peeve of mine       for quite a long time!)              >> and it simply *works* on every existing compiler (well, I should       >> probably add that it is likely that it works on every existing       >> compiler).       > [ ... ]       >> So, it does make sense that he invited/challenged me to show       >> him a reputable reference that states that the technique is       >> not legal. (I mean, we have to agree that those aspects in       >> the above paragraph, put together, constitute quite solid       >> evidence in favor of using the technique).       >       > Not really, no. That again misses the entire point. The point of       > programming to contracts and standards is that we all agree on what is       > to be guaranteed now and in the future [ ... ]              I'm not disagreeing with that --- and for what is worth, the part       that "it simply works" was added by me (it was not one of his       arguments). His main argument is that he found the technique       in *two* different books, and he did find that the code was       simpler (I do agree, but I won't necessarily defend that idea       too strongly).              But what I'm saying is that those elements *combined* (you're       focusing too much on the issue that "it works today", as if that       was the only reason, and as if we were specifically ignoring an       explicit label of UB just because we observe that it works when       we try). In the abscence of knowledge or certainty about whether       that is UB, you see the technique in two separate books, you try       it, it works, I think it is more than reasonable to assume that       it works because it is supposed to work, and not by mere       coincidence (as it is the case).              Cheers,              Carlos       --               [ See http://www.gotw.ca/resources/clcm.htm for info about ]        [ comp.lang.c++.moderated. First time posters: Do this! ]              --- SoupGate-Win32 v1.05        * Origin: you cannot sedate... all the things you hate (1:229/2)    |
[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]
(c) 1994, bbs@darkrealms.ca