add support for void return
This commit is contained in:
parent
94faa4e362
commit
09e645448d
1 changed files with 9 additions and 0 deletions
|
|
@ -75,6 +75,15 @@ namespace fc {
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
template<typename ... Args>
|
||||||
|
std::function<variant(const fc::variants&)> to_generic( const std::function<void(Args...)>& f )const
|
||||||
|
{
|
||||||
|
return [=]( const variants& args ) {
|
||||||
|
call_generic( f, args.begin(), args.end() );
|
||||||
|
return variant();
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
template<typename Result, typename... Args>
|
template<typename Result, typename... Args>
|
||||||
void operator()( const char* name, std::function<Result(Args...)>& memb )const {
|
void operator()( const char* name, std::function<Result(Args...)>& memb )const {
|
||||||
api._methods.emplace_back( to_generic( memb ) );
|
api._methods.emplace_back( to_generic( memb ) );
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue