2 // (C) Copyright John Maddock and Steve Cleary 2000.
3 // Permission to copy, use, modify, sell and
4 // distribute this software is granted provided this copyright notice appears
5 // in all copies. This software is provided "as is" without express or implied
6 // warranty, and with no claim as to its suitability for any purpose.
8 // See http://www.boost.org for most recent version including documentation.
10 // macros and helpers for working with integral-constant-expressions.
12 #ifndef BOOST_ICE_TYPE_TRAITS_HPP
13 #define BOOST_ICE_TYPE_TRAITS_HPP
15 #ifndef BOOST_CONFIG_HPP
16 #include <boost/config.hpp>
21 namespace type_traits{
23 typedef char yes_type;
24 typedef double no_type;
28 { BOOST_STATIC_CONSTANT(bool, value = true); };
31 { BOOST_STATIC_CONSTANT(bool, value = false); };
33 template <bool b1, bool b2, bool b3 = false, bool b4 = false, bool b5 = false, bool b6 = false, bool b7 = false>
35 template <bool b1, bool b2, bool b3, bool b4, bool b5, bool b6, bool b7>
38 BOOST_STATIC_CONSTANT(bool, value = true);
41 struct ice_or<false, false, false, false, false, false, false>
43 BOOST_STATIC_CONSTANT(bool, value = false);
46 template <bool b1, bool b2, bool b3 = true, bool b4 = true, bool b5 = true, bool b6 = true, bool b7 = true>
48 template <bool b1, bool b2, bool b3, bool b4, bool b5, bool b6, bool b7>
51 BOOST_STATIC_CONSTANT(bool, value = false);
54 struct ice_and<true, true, true, true, true, true, true>
56 BOOST_STATIC_CONSTANT(bool, value = true);
59 template <int b1, int b2>
62 BOOST_STATIC_CONSTANT(bool, value = (b1 == b2));
65 template <int b1, int b2>
68 BOOST_STATIC_CONSTANT(bool, value = (b1 != b2));
71 #ifndef BOOST_NO_INCLASS_MEMBER_INITIALIZATION
72 template <int b1, int b2>
73 const bool ice_eq<b1,b2>::value;
74 template <int b1, int b2>
75 const bool ice_ne<b1,b2>::value;
78 } // namespace type_traits
82 #endif // BOOST_ICE_TYPE_TRAITS_HPP