56 #ifndef OPENMESH_GENPROG_HH 57 #define OPENMESH_GENPROG_HH 70 #ifndef DOXY_IGNORE_THIS 76 template <
bool b>
struct Bool2Type {
enum { my_bool = b }; };
79 template <
int i>
struct Int2Type {
enum { my_int = i }; };
82 typedef Bool2Type<true> TrueType;
85 typedef Bool2Type<false> FalseType;
89 template <
bool Expr>
struct AssertCompile;
90 template <>
struct AssertCompile<true> {};
95 #if OM_PARTIAL_SPECIALIZATION 98 template <
bool condition,
class Then,
class Else>
99 struct IF {
typedef Then Result; };
106 template <
class Then,
class Else>
107 struct IF<false, Then, Else> {
typedef Else Result; };
119 template <
class Then,
class Else>
struct Select {
126 template <
class Then,
class Else>
struct Select {
131 template <
bool condition>
struct ChooseSelector {
132 typedef SelectThen Result;
135 template <>
struct ChooseSelector<false> {
136 typedef SelectElse Result;
146 template <
bool condition,
class Then,
class Else>
149 typedef typename ChooseSelector<condition>::Result Selector;
151 typedef typename Selector::template Select<Then, Else>::Result Result;
161 #define assert_compile(EXPR) GenProg::AssertCompile<(EXPR)>(); 164 #endif // OPENMESH_GENPROG_HH defined