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,235 of 33,346    |
|    Pete Becker to Gil N.    |
|    Re: Union padding    |
|    02 May 12 23:09:10    |
   
   cb21380f   
   From: pete@versatilecoding.com   
      
   On 2012-05-02 19:08:41 +0000, Gil N. said:   
      
   > { quoted clc++m banner removed -mod }   
   > you're not accurate, all data members of an union must begin at the   
   > same   
   > address; it is a fundamental property of an union.   
   > this is guaranteed by the C Standard which is normative for C++ unless   
   > otherwise explicitly specified.   
      
   No, it's the other way around: some parts of the C standard are explicitly   
   incorporated into C++.   
      
   > read for example ANSI/ISO 9899:1990 6.5.2.1, truncated below:   
   > "A pointer to a union object, suitably converted, points to each of   
   > its   
   > members (or if a member is a bit-field, then to the unit in which it   
   > resides), and vice versa."   
   > note: if you don't want to buy the C standard too you can use C++11   
   > standard, read   
      
   Even if you have the C standard, C++ is defined by the C++ standard
|
[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]
(c) 1994, bbs@darkrealms.ca