home bbs files messages ]

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,665 of 33,346   
   Pete Becker to Carlos Moreno   
   Re: Reference to show that if (this == N   
   11 Nov 11 05:27:41   
   
   From: pete@versatilecoding.com   
      
   On 2011-11-10 19:11:44 +0000, Carlos Moreno said:   
      
   > On 11-11-09 03:58 PM, Pete Becker wrote:   
   >   
   >> [ ... ] In the original example (no   
   >> inheritance, no virtual functions involved) there's no good reason for   
   >> a compiler to generate code that does unexpected things.   
   >   
   > Huh???   (care to elaborate on how exactly you define "unexpected"   
   > in the above sentence??  :-) )   
   >   
   > What do you mean "no good reason"???  You don't find the fact that   
   > this *is not allowed to be NULL* reason enough for the compiler to   
   > optimize away that if, thus guaranteeing that the program will   
   > crash ???   
      
   Gosh, you're cherry-picking from my response. But, yes, optimization is   
   perhaps a good reason. What I was pointing out is that this typically   
   works, but is not guaranteed. Which is, if I recall correctly, what I   
   explicitly said in text that you snipped.   
      
   --   
     Pete   
   Roundhouse Consulting, Ltd. (www.versatilecoding.com) Author of "The   
   Standard C++ Library Extensions: a Tutorial and Reference   
   (www.petebecker.com/tr1book)   
      
      
         [ 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