diff --git a/bench_lua_function.hpp b/bench_lua_function.hpp index 098b3d61..e8ae4881 100644 --- a/bench_lua_function.hpp +++ b/bench_lua_function.hpp @@ -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( ) ); diff --git a/sol/proxy.hpp b/sol/proxy.hpp index 5b98f90d..89e4495e 100644 --- a/sol/proxy.hpp +++ b/sol/proxy.hpp @@ -81,10 +81,20 @@ public: return get( ); } + template + decltype(auto) operator[](K&& key) const { + return get()[std::forward(key)]; + } + template decltype(auto) call(Args&&... args) { return get().call(std::forward(args)...); } + + template + decltype(auto) operator()(Args&&... args) { + return call<>(std::forward(args)...); + } }; template