1 .. Macros/Asserts//BOOST_MPL_ASSERT_NOT
11 #define BOOST_MPL_ASSERT_NOT( pred ) \\
12 |unspecified-token-seq| \\
19 Generates a compilation error when predicate holds true.
27 #include <boost/mpl/assert.hpp>
33 +---------------+-----------------------------------+-------------------------------------------+
34 | Parameter | Requirement | Description |
35 +===============+===================================+===========================================+
36 | ``pred`` | Boolean nullary |Metafunction| | A predicate to be asserted to be false. |
37 +---------------+-----------------------------------+-------------------------------------------+
43 For any boolean nullary |Metafunction| ``pred``:
48 BOOST_MPL_ASSERT_NOT(( pred ));
54 Generates a compilation error if ``pred::type::value != false``, otherwise
55 has no effect. Note that double parentheses are required even if no commas
56 appear in the condition.
58 When possible within the compiler's diagnostic capabilities,
59 the error message will include the predicate's full type name, and have a
64 |...| \*\*\*\*\*\*\*\*\*\*\*\*boost::mpl::not_< pred >::\*\*\*\*\*\*\*\*\*\*\*\* |...|
72 template< typename T, typename U > struct my
75 BOOST_MPL_ASSERT_NOT(( is_same< T,U > ));
80 // In instantiation of `my<void, void>':
81 // instantiated from here
83 // mpl_::failed************boost::mpl::not_<boost::is_same<void, void>
84 // >::************' to non-scalar type `mpl_::assert<false>' requested
90 |Asserts|, |BOOST_MPL_ASSERT|, |BOOST_MPL_ASSERT_MSG|, |BOOST_MPL_ASSERT_RELATION|
93 .. copyright:: Copyright © 2001-2009 Aleksey Gurtovoy and David Abrahams
94 Distributed under the Boost Software License, Version 1.0. (See accompanying
95 file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)