Fix in HasEnum that was always returning true.

This commit is contained in:
King_DuckZ 2015-07-23 23:09:35 +02:00
parent 987cdd66ef
commit 5e6c537a2d

View file

@ -45,10 +45,11 @@
private: \ private: \
struct TrueType { int a[2]; }; \ struct TrueType { int a[2]; }; \
typedef int FalseType; \ typedef int FalseType; \
template <typename C> static TrueType has_enum ( int = C::enum_name ); \ template <int> void f ( void ); \
template <typename C> static TrueType has_enum ( decltype(&f<C::enum_name>) = nullptr ); \
template <typename C> static FalseType has_enum ( ... ); \ template <typename C> static FalseType has_enum ( ... ); \
public:\ public:\
enum { value = sizeof(has_enum<T>(0)) == sizeof(TrueType) }; \ enum { value = sizeof(has_enum<T>(nullptr)) == sizeof(TrueType) }; \
} }
#endif #endif