From 74b98e37d4104fb70a03d43a8eca6f5bc8f469b9 Mon Sep 17 00:00:00 2001 From: Thomas Kemmer Date: Sat, 7 Apr 2018 19:33:14 +0200 Subject: [PATCH] Silence clang warnings. --- src/fsm.h | 22 ++-------------------- 1 file changed, 2 insertions(+), 20 deletions(-) diff --git a/src/fsm.h b/src/fsm.h index b657121..5cba849 100644 --- a/src/fsm.h +++ b/src/fsm.h @@ -280,28 +280,10 @@ namespace fsmlite { no_guard >::type; - /* FIXME g++-6: ‘(action != nullptr)’ is not a constant expression - template - using make_mem_fn_action = typename std::conditional< - action != nullptr, - mem_fn_action, - no_action - >::type; - */ - - /* FIXME g++-4.8.4: ‘(guard != nullptr)’ is not a constant expression - template - using make_mem_fn_guard = typename std::conditional< - guard != nullptr, - mem_fn_guard, - no_guard - >::type; - */ - template struct make_mem_fn_action_type { void operator()(Derived& self, const Event& event) { - if (action) (self.*action)(event); + if (action != nullptr) (self.*action)(event); } }; @@ -311,7 +293,7 @@ namespace fsmlite { template struct make_mem_fn_guard_type { bool operator()(const Derived& self, const Event& event) const { - return guard ? (self.*guard)(event) : true; + return guard != nullptr ? (self.*guard)(event) : true; } };