1 // Copyright Daniel Wallin 2009. 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>
16 void test_main(lua_State
* L
)
18 using namespace luabind
;
21 class_
<CppClass
>("CppClass")
23 .def("f", &CppClass::f
)
27 "function CppClass:f_in_lua(x)\n"
28 " return self:f(x) * 2\n"
34 "assert(x:f(1) == 1)\n"
35 "assert(x:f_in_lua(1) == 2)\n"