From 4f7686cf79f0d8634c0d5e9ecccc1927763eb5fb Mon Sep 17 00:00:00 2001 From: yhirose Date: Mon, 23 Feb 2015 10:04:25 -0500 Subject: [PATCH] Fixed problem with std::is_same. --- peglib.h | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) 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)...));