From 8794aec35a3764a70f72f8fb9bd9fe2ffabfa249 Mon Sep 17 00:00:00 2001 From: Ichthyostega Date: Fri, 17 Apr 2015 03:12:08 +0200 Subject: [PATCH] fix a warning after C++11 transition (#898) it is still questionable why GCC emits the warning "enumeral and non enumeral constant in comparison" since both arguments of the comparison are enum constants. I've asked that question on stackoverflow.... http://stackoverflow.com/questions/29685367/reasoning-behind-enumeral-and-non-enumeral-type-in-conditional-expression --- src/lib/meta/typelist-util.hpp | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/src/lib/meta/typelist-util.hpp b/src/lib/meta/typelist-util.hpp index 812aa2487..a574fdc43 100644 --- a/src/lib/meta/typelist-util.hpp +++ b/src/lib/meta/typelist-util.hpp @@ -79,15 +79,14 @@ namespace meta { template<> struct maxSize { - enum{ value = 0 }; + static constexpr int value = 0; }; template struct maxSize > { - enum{ thisval = sizeof(TY) - , nextval = maxSize::value - , value = nextval > thisval? nextval:thisval - }; + static constexpr size_t thisval = sizeof(TY); + static constexpr size_t nextval = maxSize::value; + static constexpr size_t value = nextval > thisval? nextval:thisval; }; @@ -115,7 +114,7 @@ namespace meta { /** convenience shortcut: query function */ template - bool + constexpr bool isInList() { return IsInList::value;