template <int T>
void aFunc(){}
int main()
{
int anArray[45-32];
switch(4)
{
case 4<45:
break;
}
aFunc<4*3/7&8 == 45 - 5>();
}
so this all compiles in VC++ 2005
is this standard? if so, what do the conditional operators return? 0 and 1? are there limits?
and the thing that interests me the most, can you do it in macros? defines?
Edit:
to elaborate further on the preprocessor bit:
#define STRINGAFY(n) #n
#define STRINGAFY_2(n) STRINGAFY(n)
#define SOME_RANDOM_MACRO(n) n
printf("%s", STRINGAFY(1)); //prints out "1"
printf("%s", STRINGAFY(SOME_RANDOM_MACRO(1))); //prints out "SOME_RANDOM_MACRO(1)"
printf("%s", STRINGAFY_2(SOME_RANDOM_MACRO(1))); //causes SOME_RANDOM_MACRO to be evaluated and prints out "1"
printf("%s", STRINGAFY_2(1+1)); // doesn't evaluate and print "2", prints "1+1" :(