1 // Copyright Daniel Wallin 2008. Use, modification and distribution is
2 // subject to the Boost Software License, Version 1.0. (See accompanying
3 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
6 #include <luabind/luabind.hpp>
7 #include <luabind/tag_function.hpp>
8 #include <boost/bind.hpp>
23 void test_main(lua_State
* L
)
25 using namespace luabind
;
28 def("f", tag_function
<int(int)>(boost::bind(&f
, 5, _1
))),
32 .def("f", tag_function
<int(X
&, int)>(boost::bind(&X::f
, _1
, 10, _2
)))
38 "assert(f(5) == 10)\n"
43 "assert(x:f(0) == 10)\n"
44 "assert(x:f(1) == 11)\n"
45 "assert(x:f(5) == 15)\n"