diff --git a/peglib.h b/peglib.h index 23956a9..807af82 100644 --- a/peglib.h +++ b/peglib.h @@ -212,7 +212,7 @@ any call(F fn, Args&&... args) { template < typename R, typename F, - typename std::enable_if::value>::type*& = enabler, + typename std::enable_if::type, any>::value>::type*& = enabler, typename... Args> any call(F fn, Args&&... args) { return fn(std::forward(args)...); @@ -220,7 +220,7 @@ any call(F fn, Args&&... args) { template < typename R, typename F, - typename std::enable_if::value>::type*& = enabler, + typename std::enable_if::type, SemanticValue>::value>::type*& = enabler, typename... Args> any call(F fn, Args&&... args) { return fn(std::forward(args)...).val; @@ -228,7 +228,10 @@ any call(F fn, Args&&... args) { template < typename R, typename F, - typename std::enable_if::value && !std::is_same::value && !std::is_same::value>::type*& = enabler, + typename std::enable_if< + !std::is_void::value && + !std::is_same::type, any>::value && + !std::is_same::type, SemanticValue>::value>::type*& = enabler, typename... Args> any call(F fn, Args&&... args) { return any(fn(std::forward(args)...));