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 32,151 of 33,346   
   Dave Abrahams to All   
   Re: allocate memory 'inside' POD   
   16 Apr 12 15:08:51   
   
   59d7b62f   
   From: dave@boostpro.com   
      
   on Sun Apr 15 2012, Mathias Gaunard  wrote:   
      
   > On Apr 11, 10:37 pm, Dave Abrahams  wrote:   
   >   
   >> Right, but I'm not aliasing the content of x.  I'm aliasing the memory   
   >> that follows x.   
   >   
   > It's still the same object, just not the same subobject.   
      
   No, it's not the same object.  There's a region of raw memory there with   
   no object in it.   
      
   >> Because it has behavior that's specified by the standard, whereas the   
   >> semantics of the reinterpret_cast are implementation-defined.   
   >   
   > static_cast is not any more well-defined in that case.   
      
   Yes it is.  A few years ago I had this same argument with Gabriel Dos   
   Reis and put the question to the CWG.  It was as though everyone   
   e-looked at me, e-blinked, and said, "of course the way you understand   
   it is correct.  How else would it be?"   
      
   Now, of course I could always be wrong in my memory or understanding of   
   the response, and I don't have time right now to dig through the   
   standard for the language—of which I've now forgotten the specifics—that   
   led me to my conclusion.  I formed my mental model of this stuff a while   
   ago, but I need more than your say-so to overturn my worldview.   
      
   Cheers,   
      
   --   
   Dave Abrahams   
   BoostPro Computing   
   http://www.boostpro.com   
      
      
         [ 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