1 #ifndef MSP_CORE_META_H_
2 #define MSP_CORE_META_H_
5 #include "attributes.h"
9 #pragma GCC diagnostic push
10 #pragma GCC diagnostic ignored "-Wdeprecated-declarations"
12 struct DEPRECATED RemoveConst
16 struct DEPRECATED RemoveConst<const T>
21 struct DEPRECATED RemoveReference
25 struct DEPRECATED RemoveReference<T &>
30 struct DEPRECATED RemoveConstReference
31 { typedef typename RemoveConst<typename RemoveReference<T>::Type>::Type Type; };
34 template<bool c, typename R>
35 struct DEPRECATED EnableIf;
38 struct DEPRECATED EnableIf<true, R>
42 struct DEPRECATED EnableIf<false, R>
44 #pragma GCC diagnostic pop
48 Common fragments used in SFINAE-based decider constructs.
52 struct Yes { char c[2]; };
53 struct No { char c; };
58 template<typename C, typename T>
61 enum { value = (sizeof(C::template f<T>(0))==sizeof(Yes)) };
66 struct CheckEqualityComparable: Sfinae
70 static Yes f(int (*)[sizeof(reinterpret_cast<const T &>(v)==reinterpret_cast<const T &>(v))]);
75 struct IsEqualityComparable: Sfinae::Evaluate<CheckEqualityComparable, T> { };