C++ Frontend Tales

All | Boost | General | Loki
« Previous day (Oct 30, 2006) | Main | Next day (Oct 31, 2006) »

20061031 Tuesday October 31, 2006

typeof and alignof

Now Sun Studio C++ accepts g++ extension - operator __typeof__ (as well as __typeof and typeof). Keyword typeof is available under -features=gcc command line option. So you can write:

int * x;
__typeof__(*x) n;

Operator __alignof__ now accepts expression:

unsigned v = 0;
unsigned a = __alignof__(v);

Permalink Comments [0]