提交 0f52f925 编写于 作者: M Matias Romeo

Allow passing types by reference to action methods

上级 20846c7b
......@@ -37,18 +37,16 @@ namespace eosio {
return eosio::dispatch<Contract,SecondAction,Actions...>( code, act );
}
template<typename T, typename... Args>
bool execute_action( T* obj, void (T::*func)(Args...) ) {
char buffer[action_data_size()];
read_action_data( buffer, sizeof(buffer) );
auto args = unpack<std::tuple<Args...>>( buffer, sizeof(buffer) );
auto args = unpack<std::tuple<std::decay_t<Args>...>>( buffer, sizeof(buffer) );
auto f2 = [&]( auto... a ){
(obj->*func)( a... );
};
// apply( obj, func, args );
boost::mp11::tuple_apply( f2, args );
return true;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册