help compiler infer correct templated method

This commit is contained in:
John Jones 2019-03-22 09:17:01 -05:00
parent a0ca5ab29d
commit aa50364b57

View file

@ -146,7 +146,7 @@ namespace fc {
return f();
}
template<typename R, typename Signature, typename ... Args>
template<typename R, typename Signature, typename ... Args, typename std::enable_if<std::is_function<Signature>::value,Signature>::type* = nullptr>
R call_generic( const std::function<R(std::function<Signature>,Args...)>& f, variants::const_iterator a0, variants::const_iterator e, uint32_t max_depth )
{
FC_ASSERT( a0 != e, "too few arguments passed to method" );
@ -154,7 +154,7 @@ namespace fc {
detail::callback_functor<Signature> arg0( get_connection(), a0->as<uint64_t>(1) );
return call_generic<R,Args...>( this->bind_first_arg<R,std::function<Signature>,Args...>( f, std::function<Signature>(arg0) ), a0+1, e, max_depth - 1 );
}
template<typename R, typename Signature, typename ... Args>
template<typename R, typename Signature, typename ... Args, typename std::enable_if<std::is_function<Signature>::value,Signature>::type* = nullptr>
R call_generic( const std::function<R(const std::function<Signature>&,Args...)>& f, variants::const_iterator a0, variants::const_iterator e, uint32_t max_depth )
{
FC_ASSERT( a0 != e, "too few arguments passed to method" );