This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: generalized lvalues -- patch outline




Nathan Sidwell wrote:
Thomas Kunert wrote:

A union is the correct solution.

union {
   char* c;
   int* i;
   short* s;
} p;

*p.i++;


This suggests an excellent model for describing this extension. The lvalue
cast behaves as if the object is a union of two fields.  One field with
the original type and the other field with the cast-to type.

nathan


This doesn't work for C++, does it?


TK.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]