1 //////////////////////////////////////////////////////////////////////////////
3 // (C) Copyright Ion Gaztanaga 2005-2016.
5 // Distributed under the Boost Software License, Version 1.0.
6 // (See accompanying file LICENSE_1_0.txt or copy at
7 // http://www.boost.org/LICENSE_1_0.txt)
9 // See http://www.boost.org/libs/interprocess for documentation.
11 //////////////////////////////////////////////////////////////////////////////
13 #ifndef BOOST_INTERPROCESS_DETAIL_MPL_HPP
14 #define BOOST_INTERPROCESS_DETAIL_MPL_HPP
16 #ifndef BOOST_CONFIG_HPP
17 # include <boost/config.hpp>
20 #if defined(BOOST_HAS_PRAGMA_ONCE)
27 namespace interprocess {
30 template <class T, T val>
31 struct integral_constant
33 static const T value = val;
34 typedef integral_constant<T,val> type;
38 struct bool_ : integral_constant<bool, C_>
40 static const bool value = C_;
43 typedef bool_<true> true_;
44 typedef bool_<false> false_;
46 typedef true_ true_type;
47 typedef false_ false_type;
49 typedef char yes_type;
55 template <bool B, class T = void>
61 struct enable_if_c<false, T> {};
63 template <class Cond, class T = void>
64 struct enable_if : public enable_if_c<Cond::value, T> {};
66 template <class Cond, class T = void>
67 struct disable_if : public enable_if_c<!Cond::value, T> {};
83 struct if_c<false,T1,T2>
95 typedef typename if_c<0 != T1::value, T2, T3>::type type;
99 template<std::size_t S>
102 static const std::size_t value = (S & std::size_t(1)) ? 0 : (1u + ls_zeros<(S >> 1u)>::value);
108 static const std::size_t value = 0;
114 static const std::size_t value = 0;
117 } //namespace ipcdetail {
118 } //namespace interprocess {
119 } //namespace boost {
121 #endif //#ifndef BOOST_INTERPROCESS_DETAIL_MPL_HPP