File indexing completed on 2025-01-18 09:28:26
0001
0002
0003
0004
0005
0006
0007
0008 #ifndef BOOST_ALIGN_DETAIL_INTEGRAL_CONSTANT_HPP
0009 #define BOOST_ALIGN_DETAIL_INTEGRAL_CONSTANT_HPP
0010
0011 #include <boost/config.hpp>
0012
0013 #if !defined(BOOST_NO_CXX11_HDR_TYPE_TRAITS)
0014 #include <type_traits>
0015 #endif
0016
0017 namespace boost {
0018 namespace alignment {
0019 namespace detail {
0020
0021 #if !defined(BOOST_NO_CXX11_HDR_TYPE_TRAITS)
0022 using std::integral_constant;
0023 using std::true_type;
0024 using std::false_type;
0025 #else
0026 template<class T, T Value>
0027 struct integral_constant {
0028 typedef T value_type;
0029 typedef integral_constant type;
0030
0031 BOOST_CONSTEXPR operator value_type() const BOOST_NOEXCEPT {
0032 return Value;
0033 }
0034
0035 BOOST_CONSTEXPR value_type operator()() const BOOST_NOEXCEPT {
0036 return Value;
0037 }
0038
0039 BOOST_STATIC_CONSTEXPR T value = Value;
0040 };
0041
0042 template<class T, T Value>
0043 BOOST_CONSTEXPR_OR_CONST T integral_constant<T, Value>::value;
0044
0045 typedef integral_constant<bool, true> true_type;
0046 typedef integral_constant<bool, false> false_type;
0047 #endif
0048
0049 }
0050 }
0051 }
0052
0053 #endif