39 |
template <int v> struct Int2Type { |
template <int v> struct Int2Type { |
40 |
enum { value = v } ; |
enum { value = v } ; |
41 |
}; |
}; |
42 |
|
|
43 |
|
/** A class which is either empty or contains one |
44 |
|
* instance of the other class, depending on the boolean. |
45 |
|
* Used in code :generation. |
46 |
|
*/ |
47 |
|
template <bool really, class C> class IfTempl { |
48 |
|
}; |
49 |
|
|
50 |
|
template <class C> struct IfTempl<true, C> { |
51 |
|
C c; |
52 |
|
template<class T> IfTempl(T t) : c(t) { } |
53 |
|
template<class T, class U> IfTempl(T t, U u) : c(t, u) { } |
54 |
|
}; |
55 |
|
template <class C> struct IfTempl<false, C> { |
56 |
|
template<class T> IfTempl(T t) { } |
57 |
|
template<class T, class U> IfTempl(T t, U u) { } |
58 |
|
}; |
59 |
} |
} |
60 |
} |
} |
61 |
|
|