18 #ifndef itkMetaProgrammingLibrary_h
19 #define itkMetaProgrammingLibrary_h
40 typedef bool ValueType;
41 typedef TrueType Type;
43 itkStaticConstMacro(Value, ValueType,
true);
44 operator ValueType() {
return Value; }
53 typedef bool ValueType;
54 typedef FalseType Type;
55 itkStaticConstMacro(Value, ValueType,
false);
56 operator ValueType() {
return Value; }
67 template <
bool VP,
typename T1,
typename T2>
struct If;
69 template <
typename T1,
typename T2>
struct If<true , T1, T2>{
typedef T1 Type; };
70 template <
typename T1,
typename T2>
struct If<false, T1, T2>{
typedef T2 Type; };
80 template <
bool VF1,
bool VF2,
bool VF3=false>
struct OrC : TrueType { };
82 template <>
struct OrC<false, false,false> : FalseType {};
97 template <
typename TF1,
typename TF2,
typename TF3=FalseType>
struct Or :
OrC<TF1::Value, TF2::Value, TF3::Value>
106 template <
bool VF1,
bool VF2>
struct AndC : FalseType { };
108 template <>
struct AndC<true, true> : TrueType {};
122 template <
typename TF1,
typename TF2>
struct And :
AndC<TF1::Value, TF2::Value>
131 template <
bool VF1,
bool VF2>
struct XorC : FalseType { };
133 template <>
struct XorC<true, false> : TrueType {};
134 template <>
struct XorC<false, true> : TrueType {};
148 template <
typename TF1,
typename TF2>
struct Xor :
XorC<TF1::Value, TF2::Value>
156 template <
bool VF >
struct NotC : FalseType { };
158 template <>
struct NotC<false> : TrueType {};
159 template <>
struct NotC<true> : FalseType {};
172 template <
typename TF>
struct Not :
NotC<TF::Value>
180 using mpl::FalseType;
184 #endif // itkMetaProgrammingLibrary_h
NotC< TF::Value >::Type Type
OrC< TF1::Value, TF2::Value, TF3::Value >::Type Type
AndC< TF1::Value, TF2::Value >::Type Type
XorC< TF1::Value, TF2::Value >::Type Type