
21 Jun
2011
21 Jun
'11
4:57 a.m.
However I was thinking... Is it not possible to test for const int x being 0 at compile time, possibly with MPL equal_to ? Then you could handle the case where the "int const" is 0, returning true when that is the case, otherwise returning false.
In fact, if it is an "integral constant expression", the answer is yes. But if not, I suspect the code would yield a compile time error. But the arguments of the trait are types not linked to any value. Then it seems to me that it is impossible. Frédéric