Boost logo

Boost :

From: Robert Ramey (ramey_at_[hidden])
Date: 2004-06-03 15:28:48


BOOST_STATIC_ASSERT -

On occasion I find it convenient to use:

BOOST_STATIC_ASSERT(false)

In templated code that should be unreachable. However, its doesn't work
with compilers that are too smart for their own good. In order to make this
work I need something like:

BOOST_STATIC_ASSERT(boost::false_<T>::value)

Where boost::false<T> is a type that yields false for any type T.

Am I correct here? Where should such a code snippet be placed? Could it be
added to mpl, type_trait or what?

Robert Ramey


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