My compiler is the latest VC++ 2013 RC.
int f(bool b)
{
return {}; // OK
return b ? 1 : { }; // C2059: syntax error : '{'
return b ? 1 : {0}; // C2059: syntax error : '{'
return b ? {1} : {0}; // C2059: syntax error : '{'
}
Why can braced-init-list not be used in ternary operator?
Is this behavior defined as ill-formed by the C++ standard, or just a bug of the VC++ compiler?