diff --git a/include/chaiscript/dispatchkit/register_function.hpp b/include/chaiscript/dispatchkit/register_function.hpp index 8334b7b6..1c58840a 100644 --- a/include/chaiscript/dispatchkit/register_function.hpp +++ b/include/chaiscript/dispatchkit/register_function.hpp @@ -107,31 +107,6 @@ namespace chaiscript return fun(detail::bind_first(std::forward(t), q)); } - /// \brief Creates a new Proxy_Function object from a free function or member function and binds the first and second parameters of it - /// \param[in] t Function / member to expose - /// \param[in] q Value to bind to first parameter - /// \param[in] r Value to bind to second parameter - /// - /// \b Example: - /// \code - /// struct MyClass - /// { - /// void memberfunction(int); - /// }; - /// - /// MyClass obj; - /// chaiscript::ChaiScript chai; - /// // Add function taking only no arguments, and permanently bound to "obj" and "1" - /// // memberfunction() will be equivalent to obj.memberfunction(1) - /// chai.add(fun(&MyClass::memberfunction, std::ref(obj), 1), "memberfunction"); - /// \endcode - /// - /// \sa \ref adding_functions - template - Proxy_Function fun(T &&t, Q &&q, R &&r) - { - return fun(detail::bind_first(detail::bind_first(std::forward(t), std::forward(q)), std::forward(r))); - } } diff --git a/samples/example.cpp b/samples/example.cpp index 0316ebf6..9a0f0070 100644 --- a/samples/example.cpp +++ b/samples/example.cpp @@ -108,9 +108,9 @@ int main(int /*argc*/, char * /*argv*/[]) { // A shortcut to using eval is just to use the chai operator() chai("log(\"Test Module\", \"Test Message\");"); - //Finally, it is possible to register any std::function as a system function, in this + //Finally, it is possible to register a lambda as a system function, in this //way, we can, for instance add a bound member function to the system - chai.add(fun(&System::do_callbacks, std::ref(system), std::string("Bound Test")), "do_callbacks"); + chai.add(fun([&system](){ return system.do_callbacks("Bound Test"); }), "do_callbacks"); //Call bound version of do_callbacks chai("do_callbacks()");