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
1 changed files with 3 additions and 2 deletions

View File

@ -45,10 +45,11 @@
private: \
struct TrueType { int a[2]; }; \
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 ( ... ); \
public:\
enum { value = sizeof(has_enum<T>(0)) == sizeof(TrueType) }; \
enum { value = sizeof(has_enum<T>(nullptr)) == sizeof(TrueType) }; \
}
#endif