rice/detail/RubyFunction.hpp in rice-4.0.4 vs rice/detail/RubyFunction.hpp in rice-4.1.0

- old
+ new

@@ -9,31 +9,26 @@ rb_protect only supports calling methods that take one argument. Thus we invoke rb_protect telling it to invoke Ruby_Function::call with an instance of a Ruby_Function. That instance then in turn calls the original Ruby method passing along its required arguments. */ - template<typename Function_T, typename Return_T, typename...Arg_Ts> + template<typename Function_T, typename...Arg_Ts> class RubyFunction { public: + using Return_T = typename function_traits<Function_T>::return_type; + + public: RubyFunction(Function_T func, const Arg_Ts&... args); Return_T operator()(); private: Function_T func_; std::tuple<Arg_Ts...> args_; }; - template<typename Return_T, typename ...Arg_Ts> - Return_T protect(Return_T(*func)(Arg_Ts...), Arg_Ts...args); + template<typename Function_T, typename ...Arg_Ts> + auto protect(Function_T func, Arg_Ts...args); } - -namespace Rice -{ - template<typename Return_T, typename ...Arg_Ts> - [[deprecated("Please use detail::protect")]] - Return_T protect(Return_T(*func)(Arg_Ts...), Arg_Ts...args); -} - #include "RubyFunction.ipp" #endif // Rice__detail__ruby_function__hpp_ \ No newline at end of file