Boost logo

Boost :

From: Markus Schöpflin (markus.schoepflin_at_[hidden])
Date: 2002-10-29 07:30:59


John Maddock wrote:

>>This fix should be easy:
>
>> BOOST_CHECK_INTEGRAL_CONSTANT(static_cast<bool>(::tt::has_trivial_constructor<bool>::value), true);
>
> That's seriously ugly, IMO the test program uses type traits as they are
> meant to be used: as template arguments, and enum values can certainly be
> used in non-type template arguments, even if the enum itself is anonymous
> IMO. I guess I can patch BOOST_CHECK_INTEGRAL_CONSTANT, but that's really
> just hiding the issue.

Hmm, obviously I was a litte too careless when composing the first
message. BOOST_CHECK_INTEGRAL_CONSTANT() is not a macro of boost.test
but it is defined in the type traits test files.

But the arguments are used as template arguments to the following:

template <class T, class U>
bool tt_compare(T found, U expected)
{ return static_cast<U>(found) == expected; }

And this isn't allowed with unnamed types, or is it?

Markus


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk