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,223 of 33,346   
   red floyd to Daryle Walker   
   Re: Union padding   
   30 Apr 12 15:42:57   
   
   e14dad0b   
   From: no.spam.here@its.invalid   
      
   On 4/30/2012 1:08 PM, Daryle Walker wrote:   
   >   
   > I've been testing out types like:   
   >   
   > union   
   > {   
   >       T1  a;   
   >       T2  b;   
   >       union   
   >       {   
   >           T3 ca;   
   >           T4 cb;   
   >       }  c;   
   > }  d;   
   >   
   > [redacted]   
   > Looking at Section 9.5 Paragraph 1 in the copy of C++11   
   > I just bought, and it seems that my desired behavior isn't guaranteed.   
   > There may be padding between the start of the union and any of its   
   > members, and the padding for each member may differ.  Am I accurate in   
   > this assessment?   
   >   
   >From N3242.  9.5/5  The final sentence of the example implicitly notes   
   that union members all have the same address.  I'm not sure if this is   
   normative or not.   
      
      
   --   
         [ 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