18 #ifndef itkMetaProgrammingLibrary_h
19 #define itkMetaProgrammingLibrary_h
40 using ValueType = bool;
41 using Type = TrueType;
43 static constexpr ValueType Value =
true;
44 operator ValueType() {
return Value; }
53 using ValueType = bool;
54 using Type = FalseType;
55 static constexpr ValueType Value =
false;
56 operator ValueType() {
return Value; }
66 template <
bool VP,
typename T1,
typename T2>
struct If;
68 template <
typename T1,
typename T2>
struct If<true , T1, T2>{
using Type = T1; };
69 template <
typename T1,
typename T2>
struct If<false, T1, T2>{
using Type = T2; };
79 template <
bool VF1,
bool VF2,
bool VF3=false>
struct OrC : TrueType { };
81 template <>
struct OrC<false, false,false> : FalseType {};
96 template <
typename TF1,
typename TF2,
typename TF3=FalseType>
struct Or :
OrC<TF1::Value, TF2::Value, TF3::Value>
105 template <
bool VF1,
bool VF2>
struct AndC : FalseType { };
107 template <>
struct AndC<true, true> : TrueType {};
121 template <
typename TF1,
typename TF2>
struct And :
AndC<TF1::Value, TF2::Value>
130 template <
bool VF1,
bool VF2>
struct XorC : FalseType { };
132 template <>
struct XorC<true, false> : TrueType {};
133 template <>
struct XorC<false, true> : TrueType {};
147 template <
typename TF1,
typename TF2>
struct Xor :
XorC<TF1::Value, TF2::Value>
155 template <
bool VF >
struct NotC : FalseType { };
157 template <>
struct NotC<false> : TrueType {};
158 template <>
struct NotC<true> : FalseType {};
171 template <
typename TF>
struct Not :
NotC<TF::Value>
179 using mpl::FalseType;
183 #endif // itkMetaProgrammingLibrary_h
typename XorC< TF1::Value, TF2::Value >::Type Type
typename OrC< TF1::Value, TF2::Value, TF3::Value >::Type Type
typename AndC< TF1::Value, TF2::Value >::Type Type
typename NotC< TF::Value >::Type Type