Boost logo

Boost :

From: deansturtevant_at_[hidden]
Date: 2001-05-27 10:48:20


--- In boost_at_y..., Beman Dawes <bdawes_at_a...> wrote:
> This program works as expected with the GNU, Metrowerks, and
Microsoft
> compilers:
>
> #include <iostream>
> #include <boost/static_assert.hpp>
>
> template< typename T >
> void f( T & t )
> {
> std::cout << sizeof(T) << "\n";
> BOOST_STATIC_ASSERT( sizeof(T) ); // line in question
> }
>
> int main()
> {
> long l;
> f(l);
> return 0;
> }
>
Am I being overly pedantic when I say that the argument to an assert
should be explicitly a boolean expression? i.e. - does
BOOST_STATIC_ASSERT( sizeof(T) != 0 );
have any problems?

- Dean


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