Boost logo

Boost :

Subject: Re: [boost] [type traits] Strange behaviour of comparison operators with pointers
From: Frédéric Bron (frederic.bron_at_[hidden])
Date: 2011-06-21 00:57:52

> 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.


Boost list run by bdawes at, gregod at, cpdaniel at, john at