File indexing completed on 2025-01-18 09:51:03
0001 #ifndef BOOST_QVM_ENABLE_IF_HPP_INCLUDED
0002 #define BOOST_QVM_ENABLE_IF_HPP_INCLUDED
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017 namespace boost { namespace qvm {
0018
0019 template<typename T, typename R=void>
0020 struct enable_if_has_type
0021 {
0022 typedef R type;
0023 };
0024
0025 template <bool B, class T = void>
0026 struct enable_if_c {
0027 typedef T type;
0028 };
0029
0030 template <class T>
0031 struct enable_if_c<false, T> {};
0032
0033 template <class Cond, class T = void>
0034 struct enable_if : public enable_if_c<Cond::value, T> {};
0035
0036 template <bool B, class T>
0037 struct lazy_enable_if_c {
0038 typedef typename T::type type;
0039 };
0040
0041 template <class T>
0042 struct lazy_enable_if_c<false, T> {};
0043
0044 template <class Cond, class T>
0045 struct lazy_enable_if : public lazy_enable_if_c<Cond::value, T> {};
0046
0047
0048 template <bool B, class T = void>
0049 struct disable_if_c {
0050 typedef T type;
0051 };
0052
0053 template <class T>
0054 struct disable_if_c<true, T> {};
0055
0056 template <class Cond, class T = void>
0057 struct disable_if : public disable_if_c<Cond::value, T> {};
0058
0059 template <bool B, class T>
0060 struct lazy_disable_if_c {
0061 typedef typename T::type type;
0062 };
0063
0064 template <class T>
0065 struct lazy_disable_if_c<true, T> {};
0066
0067 template <class Cond, class T>
0068 struct lazy_disable_if : public lazy_disable_if_c<Cond::value, T> {};
0069
0070
0071
0072
0073
0074 template<typename T, typename R=void>
0075 struct enable_if_has_type2
0076 {
0077 typedef R type;
0078 };
0079
0080 template <bool B, class T = void>
0081 struct enable_if_c2 {
0082 typedef T type;
0083 };
0084
0085 template <class T>
0086 struct enable_if_c2<false, T> {};
0087
0088 template <class Cond, class T = void>
0089 struct enable_if2 : public enable_if_c2<Cond::value, T> {};
0090
0091 template <bool B, class T>
0092 struct lazy_enable_if_c2 {
0093 typedef typename T::type type;
0094 };
0095
0096 template <class T>
0097 struct lazy_enable_if_c2<false, T> {};
0098
0099 template <class Cond, class T>
0100 struct lazy_enable_if2 : public lazy_enable_if_c2<Cond::value, T> {};
0101
0102
0103 template <bool B, class T = void>
0104 struct disable_if_c2 {
0105 typedef T type;
0106 };
0107
0108 template <class T>
0109 struct disable_if_c2<true, T> {};
0110
0111 template <class Cond, class T = void>
0112 struct disable_if2 : public disable_if_c2<Cond::value, T> {};
0113
0114 template <bool B, class T>
0115 struct lazy_disable_if_c2 {
0116 typedef typename T::type type;
0117 };
0118
0119 template <class T>
0120 struct lazy_disable_if_c2<true, T> {};
0121
0122 template <class Cond, class T>
0123 struct lazy_disable_if2 : public lazy_disable_if_c2<Cond::value, T> {};
0124
0125 } }
0126
0127 #endif