detect anonymous union at compile time

cal callumenator at gmail.com
Thu Mar 28 13:02:17 PDT 2013


Given:

struct S {
   union {
     int i;
     float f;
   }
}

is there any way to detect the fact that fields i and f will have 
the same offset from S? (Creating an instance of S and getting 
the relative addresses only works if the union is public).


More information about the Digitalmars-d-learn mailing list