generalized lvalues -- patch outline
Thomas Kunert
kunert@physik.tu-dresden.de
Tue Nov 23 18:57:00 GMT 2004
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.
More information about the Gcc
mailing list