From 09e645448dc26b75f78d37ad966419abfbc79c83 Mon Sep 17 00:00:00 2001 From: Daniel Larimer Date: Mon, 30 Mar 2015 14:08:26 -0400 Subject: [PATCH] add support for void return --- include/fc/rpc/api_connection.hpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/include/fc/rpc/api_connection.hpp b/include/fc/rpc/api_connection.hpp index 737a224..a4781c9 100644 --- a/include/fc/rpc/api_connection.hpp +++ b/include/fc/rpc/api_connection.hpp @@ -75,6 +75,15 @@ namespace fc { }; } + template + std::function to_generic( const std::function& f )const + { + return [=]( const variants& args ) { + call_generic( f, args.begin(), args.end() ); + return variant(); + }; + } + template void operator()( const char* name, std::function& memb )const { api._methods.emplace_back( to_generic( memb ) );