Fix result_of_is_callable to support references to function pointers.

On compilers without the support of expression SFINAE, decltype-based
result_of<FP&(...)> failed to compile (FP is a function pointer type).
This commit is contained in:
morinmorin 2017-09-20 23:37:39 +09:00
parent 88c36c1941
commit fb2f110eb4

View File

@ -82,15 +82,12 @@ struct BOOST_PP_CAT(result_of_callable_fun_2_, BOOST_PP_ITERATION())<R(BOOST_PP_
}; };
template<typename F> template<typename F>
struct BOOST_PP_CAT(result_of_callable_fun_, BOOST_PP_ITERATION()); struct BOOST_PP_CAT(result_of_callable_fun_, BOOST_PP_ITERATION())
template<typename F>
struct BOOST_PP_CAT(result_of_callable_fun_, BOOST_PP_ITERATION())<F *>
: BOOST_PP_CAT(result_of_callable_fun_2_, BOOST_PP_ITERATION())<F> : BOOST_PP_CAT(result_of_callable_fun_2_, BOOST_PP_ITERATION())<F>
{}; {};
template<typename F> template<typename F>
struct BOOST_PP_CAT(result_of_callable_fun_, BOOST_PP_ITERATION())<F &> struct BOOST_PP_CAT(result_of_callable_fun_, BOOST_PP_ITERATION())<F *>
: BOOST_PP_CAT(result_of_callable_fun_2_, BOOST_PP_ITERATION())<F> : BOOST_PP_CAT(result_of_callable_fun_2_, BOOST_PP_ITERATION())<F>
{}; {};
@ -99,7 +96,7 @@ struct BOOST_PP_CAT(result_of_select_call_wrapper_type_, BOOST_PP_ITERATION())
: mpl::eval_if< : mpl::eval_if<
is_class<typename remove_reference<F>::type>, is_class<typename remove_reference<F>::type>,
result_of_wrap_callable_class<F>, result_of_wrap_callable_class<F>,
mpl::identity<BOOST_PP_CAT(result_of_callable_fun_, BOOST_PP_ITERATION())<typename remove_cv<F>::type> > mpl::identity<BOOST_PP_CAT(result_of_callable_fun_, BOOST_PP_ITERATION())<typename remove_cv<typename remove_reference<F>::type>::type> >
> >
{}; {};