diff --git a/include/fc/rpc/api_connection.hpp b/include/fc/rpc/api_connection.hpp index 4f97922..737a224 100644 --- a/include/fc/rpc/api_connection.hpp +++ b/include/fc/rpc/api_connection.hpp @@ -58,7 +58,7 @@ namespace fc { R call_generic( const std::function& f, variants::const_iterator a0, variants::const_iterator e )const { FC_ASSERT( a0 != e ); - return call_generic( bind_first_arg( f, a0->as() ), a0+1, e ); + return call_generic( bind_first_arg( f, a0->as< typename std::decay::type >() ), a0+1, e ); } template @@ -71,7 +71,7 @@ namespace fc { std::function to_generic( const std::function& f )const { return [=]( const variants& args ) { - return call_generic( f, args.begin(), args.end() ); + return variant( call_generic( f, args.begin(), args.end() ) ); }; } diff --git a/tests/api.cpp b/tests/api.cpp index c9661a8..440479c 100644 --- a/tests/api.cpp +++ b/tests/api.cpp @@ -22,8 +22,9 @@ class login_api return *calc; } fc::optional> calc; + std::set test( const std::string&, const std::string& ){}; }; -FC_API( login_api, (get_calc) ); +FC_API( login_api, (get_calc)(test) ); using namespace fc;