I tried the following code snippet with MSVC 10, where it works fine.
enum
{
FOO = (sizeof(void*) == 8 ? 10 : 20)
};
int main()
{
return FOO;
}
What I would like to know is: Does the C++ Standard (preferably C++98) allow me to use the conditional-operator in a constant expression when all operands are constant expressions, or is this a Microsoft quirk/extension?