From 5e6c537a2d7c401a0040f7c1fe74fbf20f567c7e Mon Sep 17 00:00:00 2001 From: King_DuckZ Date: Thu, 23 Jul 2015 23:09:35 +0200 Subject: [PATCH] Fix in HasEnum that was always returning true. --- include/vectorwrapper/has_method.hpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/include/vectorwrapper/has_method.hpp b/include/vectorwrapper/has_method.hpp index 5deb031..d3eda22 100644 --- a/include/vectorwrapper/has_method.hpp +++ b/include/vectorwrapper/has_method.hpp @@ -45,10 +45,11 @@ private: \ struct TrueType { int a[2]; }; \ typedef int FalseType; \ - template static TrueType has_enum ( int = C::enum_name ); \ + template void f ( void ); \ + template static TrueType has_enum ( decltype(&f) = nullptr ); \ template static FalseType has_enum ( ... ); \ public:\ - enum { value = sizeof(has_enum(0)) == sizeof(TrueType) }; \ + enum { value = sizeof(has_enum(nullptr)) == sizeof(TrueType) }; \ } #endif