Test object identity with shared_ptr_converter.
[luabind.git] / luabind / detail / property.hpp
blob2c30ce000a32600e9e433d8c5dc49caccadec444
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 #ifndef LUABIND_PROPERTY_081020_HPP
6 # define LUABIND_PROPERTY_081020_HPP
8 namespace luabind { namespace detail {
10 template <class Class, class T, class Result = T>
11 struct access_member_ptr
13 access_member_ptr(T Class::* mem_ptr)
14 : mem_ptr(mem_ptr)
17 Result operator()(Class const& x) const
19 return const_cast<Class&>(x).*mem_ptr;
22 void operator()(Class& x, T const& value) const
24 x.*mem_ptr = value;
27 T Class::* mem_ptr;
30 }} // namespace luabind::detail
32 #endif // LUABIND_PROPERTY_081020_HPP