fixed proxy (perhaps I broke it recently?)

This commit is contained in:
ThePhD 2016-01-24 09:19:36 -05:00
parent 8c9f8c3341
commit 7c7f862cb4
2 changed files with 12 additions and 2 deletions

View File

@ -84,8 +84,8 @@ void bench_lua_function( const std::string& dir, std::string& configurationname
nonius::benchmark benchmarks [] = {
nonius::benchmark( "fast_function - function_result", sol_fast_function_result_lua_bench( ) ),
nonius::benchmark( "fast_function - call<>", sol_fast_direct_lua_bench( ) ),
nonius::benchmark( "safe_function - function_result", sol_function_result_lua_bench( ) ),
nonius::benchmark( "safe_function - call<>", sol_direct_lua_bench( ) ),
nonius::benchmark( "function - function_result", sol_function_result_lua_bench( ) ),
nonius::benchmark( "function - call<>", sol_direct_lua_bench( ) ),
nonius::benchmark( "plain C", c_direct_lua_bench( ) ),
};
nonius::go( cfg, std::begin( benchmarks ), std::end( benchmarks ), nonius::html_reporter( ) );

View File

@ -81,10 +81,20 @@ public:
return get<T&>( );
}
template <typename K>
decltype(auto) operator[](K&& key) const {
return get<table>()[std::forward<K>(key)];
}
template<typename... Ret, typename... Args>
decltype(auto) call(Args&&... args) {
return get<function>().call<Ret...>(std::forward<Args>(args)...);
}
template<typename... Args>
decltype(auto) operator()(Args&&... args) {
return call<>(std::forward<Args>(args)...);
}
};
template<typename Table, typename Key, typename T>