Teach adopt() to hold the adopted pointer in custom pointer type.
[luabind.git] / test / test_shadow.cpp
blob9bcdd1a0e7f6f55f7bffc6effdbc2a62eabbfe56
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)
5 #include "test.hpp"
6 #include <luabind/luabind.hpp>
8 using namespace luabind;
10 struct X
12 void f()
16 struct Y : X
18 void f()
22 void test_main(lua_State* L)
24 module(L) [
25 class_<X>("X")
26 .def(constructor<>())
27 .def("f", &X::f),
29 class_<Y, X>("Y")
30 .def(constructor<>())
31 .def("f", &Y::f)
34 DOSTRING(L,
35 "x = X()\n"
36 "x:f()\n"
39 DOSTRING(L,
40 "x = Y()\n"
41 "x:f()\n"