1 
2 // Copyright Aleksey Gurtovoy 2001-2004
3 //
4 // Distributed under the Boost Software License,Version 1.0.
5 // (See accompanying file LICENSE_1_0.txt or copy at
6 // http://www.boost.org/LICENSE_1_0.txt)
7 //
8 // See http://www.boost.org/libs/mpl for documentation.
9 
10 // $Id$
11 // $Date$
12 // $Revision$
13 
14 #include <boost/mpl/bool.hpp>
15 #include <boost/mpl/aux_/test.hpp>
16 
17 #include <cassert>
18 
19 #if defined(BOOST_NO_CXX11_CONSTEXPR)
20 #define CONSTEXPR_BOOL_TEST(c)
21 #else
22 #define CONSTEXPR_BOOL_TEST(c) { static_assert(bool_<c>() == c, "Constexpr for bool_ failed"); }
23 #endif
24 
25 #define BOOL_TEST(c) \
26     { MPL_ASSERT(( is_same< bool_<c>::value_type, bool > )); } \
27     { MPL_ASSERT(( is_same< bool_<c>, c##_ > )); } \
28     { MPL_ASSERT(( is_same< bool_<c>::type, bool_<c> > )); } \
29     { MPL_ASSERT_RELATION( bool_<c>::value, ==, c ); } \
30     CONSTEXPR_BOOL_TEST(c) \
31     BOOST_TEST( bool_<c>() == c ); \
32 /**/
33 
MPL_TEST_CASE()34 MPL_TEST_CASE()
35 {
36     BOOL_TEST(true)
37     BOOL_TEST(false)
38 }
39