@() directive

The @(x) directive forces compile time evaluation of expressions. Note that x is macro expanded before being evaluated as an expression.

Before translationAfter translation
int A[] =
{
    @(2*2*2*2), @(2^^4), @(1 << 4),
    @(0xabcd & 0xf), @(3 | 5), @(27 % 4),
    @("x" == "y"), @("x" < "y"+'z'),
    @(1<2 && 2<4), @(!(1+1 < 2) ? 10 : 20)
};
int A[] =
{
    16, 16, 16,
    13, 7, 3,
    false, true,
    true, 10,
};