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>
7 #include <boost/shared_ptr.hpp>
38 const_cast<ptr
&>(other
).p
= 0;
49 X
* get_pointer(ptr
const& p
)
54 std::auto_ptr
<X
> make1()
56 return std::auto_ptr
<X
>(new X(1));
59 boost::shared_ptr
<X
> make2()
61 return boost::shared_ptr
<X
>(new X(2));
69 void test_main(lua_State
* L
)
71 using namespace luabind
;
75 .def_readonly("value", &X::value
),
88 TEST_CHECK(X::alive
== 3);
91 "assert(x1.value == 1)\n"
92 "assert(x2.value == 2)\n"
93 "assert(x3.value == 3)\n"
103 assert(X::alive
== 0);