Boost logo

Boost :

From: John Maddock (jm_at_[hidden])
Date: 2002-10-29 06:45:06


> > Almost all type_traits tests fail because of a problem in the
test-program
> > AFAICT (and not in the type_traits code itself). Maybe somebody more
familiar
> > with the test-program can help me out here : you can find the status at
:
> >
> > http://boost.sourceforge.net/regression-logs/cs-vacpp-full_6.html
> >
> > and the error msg at :
> >
> >
http://boost.sourceforge.net/regression-logs/cs-vacpp-links_6.html#has_trivi
al_constructor_test
>
> The first error is:
> "../libs/type_traits/test/has_trivial_constructor_test.cpp", line
> 13.1: 1540-0717 (S) The template argument cannot use an unnamed type.
>
> The source line reads:
>
> BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_constructor<bool>::value,
> true);
>
> This is a (well known? at least to me it is...) problem with
> BOOST_STATIC_CONSTANT and boost.test and VACPP (well, other compilers
> should be affected, too)
>
> For VACPP, BOOST_STATIC_CONSTANT uses an unnamed enum to define
> ::tt::has_trivial_constructor<bool>::value. boost.test uses the
> arguments to the test macro as parameters for a template an this
> doesn't work as the compiler error tells us.
>
> This fix should be easy:
>
>
BOOST_CHECK_INTEGRAL_CONSTANT(static_cast<bool>(::tt::has_trivial_constructo
r<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.

John Maddock
http://ourworld.compuserve.com/homepages/john_maddock/index.htm


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