File indexing completed on 2025-01-18 09:40:52
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014 #ifndef BOOST_MOVE_DETAIL_META_UTILS_CORE_HPP
0015 #define BOOST_MOVE_DETAIL_META_UTILS_CORE_HPP
0016
0017 #ifndef BOOST_CONFIG_HPP
0018 # include <boost/config.hpp>
0019 #endif
0020 #
0021 #if defined(BOOST_HAS_PRAGMA_ONCE)
0022 # pragma once
0023 #endif
0024
0025
0026
0027 namespace boost {
0028 namespace move_detail {
0029
0030 template<typename T>
0031 struct voider { typedef void type; };
0032
0033
0034
0035
0036 template<bool C, typename T1, typename T2>
0037 struct if_c
0038 {
0039 typedef T1 type;
0040 };
0041
0042 template<typename T1, typename T2>
0043 struct if_c<false,T1,T2>
0044 {
0045 typedef T2 type;
0046 };
0047
0048
0049
0050
0051 template<typename T1, typename T2, typename T3>
0052 struct if_ : if_c<0 != T1::value, T2, T3>
0053 {};
0054
0055
0056
0057
0058 struct enable_if_nat{};
0059
0060 template <bool B, class T = enable_if_nat>
0061 struct enable_if_c
0062 {
0063 typedef T type;
0064 };
0065
0066 template <class T>
0067 struct enable_if_c<false, T> {};
0068
0069
0070
0071
0072 template <class Cond, class T = enable_if_nat>
0073 struct enable_if : enable_if_c<Cond::value, T> {};
0074
0075
0076
0077
0078 template <bool B, class T = enable_if_nat>
0079 struct disable_if_c
0080 : enable_if_c<!B, T>
0081 {};
0082
0083
0084
0085
0086 template <class Cond, class T = enable_if_nat>
0087 struct disable_if : enable_if_c<!Cond::value, T> {};
0088
0089
0090
0091
0092 template<class T, T v>
0093 struct integral_constant
0094 {
0095 static const T value = v;
0096 typedef T value_type;
0097 typedef integral_constant<T, v> type;
0098
0099 operator T() const { return value; }
0100 T operator()() const { return value; }
0101 };
0102
0103 typedef integral_constant<bool, true > true_type;
0104 typedef integral_constant<bool, false > false_type;
0105
0106
0107
0108
0109
0110 template<class T, class U>
0111 struct is_same
0112 {
0113 static const bool value = false;
0114 };
0115
0116 template<class T>
0117 struct is_same<T, T>
0118 {
0119 static const bool value = true;
0120 };
0121
0122
0123
0124
0125 template <class T, class U, class R = enable_if_nat>
0126 struct enable_if_same : enable_if<is_same<T, U>, R> {};
0127
0128
0129
0130
0131 template <class T, class U, class R = enable_if_nat>
0132 struct disable_if_same : disable_if<is_same<T, U>, R> {};
0133
0134 }
0135 }
0136
0137 #endif