mirror of
https://github.com/yhirose/cpp-peglib.git
synced 2025-01-22 21:35:29 +00:00
Fixed problem with std::is_same.
This commit is contained in:
parent
7a81ced514
commit
4f7686cf79
9
peglib.h
9
peglib.h
@ -212,7 +212,7 @@ any call(F fn, Args&&... args) {
|
|||||||
|
|
||||||
template <
|
template <
|
||||||
typename R, typename F,
|
typename R, typename F,
|
||||||
typename std::enable_if<std::is_same<R, any>::value>::type*& = enabler,
|
typename std::enable_if<std::is_same<typename std::remove_cv<R>::type, any>::value>::type*& = enabler,
|
||||||
typename... Args>
|
typename... Args>
|
||||||
any call(F fn, Args&&... args) {
|
any call(F fn, Args&&... args) {
|
||||||
return fn(std::forward<Args>(args)...);
|
return fn(std::forward<Args>(args)...);
|
||||||
@ -220,7 +220,7 @@ any call(F fn, Args&&... args) {
|
|||||||
|
|
||||||
template <
|
template <
|
||||||
typename R, typename F,
|
typename R, typename F,
|
||||||
typename std::enable_if<std::is_same<R, SemanticValue>::value>::type*& = enabler,
|
typename std::enable_if<std::is_same<typename std::remove_cv<R>::type, SemanticValue>::value>::type*& = enabler,
|
||||||
typename... Args>
|
typename... Args>
|
||||||
any call(F fn, Args&&... args) {
|
any call(F fn, Args&&... args) {
|
||||||
return fn(std::forward<Args>(args)...).val;
|
return fn(std::forward<Args>(args)...).val;
|
||||||
@ -228,7 +228,10 @@ any call(F fn, Args&&... args) {
|
|||||||
|
|
||||||
template <
|
template <
|
||||||
typename R, typename F,
|
typename R, typename F,
|
||||||
typename std::enable_if<!std::is_void<R>::value && !std::is_same<R, any>::value && !std::is_same<R, SemanticValue>::value>::type*& = enabler,
|
typename std::enable_if<
|
||||||
|
!std::is_void<R>::value &&
|
||||||
|
!std::is_same<typename std::remove_cv<R>::type, any>::value &&
|
||||||
|
!std::is_same<typename std::remove_cv<R>::type, SemanticValue>::value>::type*& = enabler,
|
||||||
typename... Args>
|
typename... Args>
|
||||||
any call(F fn, Args&&... args) {
|
any call(F fn, Args&&... args) {
|
||||||
return any(fn(std::forward<Args>(args)...));
|
return any(fn(std::forward<Args>(args)...));
|
||||||
|
Loading…
Reference in New Issue
Block a user