My Project
property.hpp
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)
4 
5 #ifndef LUABIND_PROPERTY_081020_HPP
6 # define LUABIND_PROPERTY_081020_HPP
7 
8 namespace luabind { namespace detail {
9 
10 template <class Class, class T, class Result = T>
12 {
13  access_member_ptr(T Class::* mem_ptr)
14  : mem_ptr(mem_ptr)
15  {}
16 
17  Result operator()(Class const& x) const
18  {
19  return const_cast<Class&>(x).*mem_ptr;
20  }
21 
22  void operator()(Class& x, T const& value) const
23  {
24  x.*mem_ptr = value;
25  }
26 
27  T Class::* mem_ptr;
28 };
29 
30 }} // namespace luabind::detail
31 
32 #endif // LUABIND_PROPERTY_081020_HPP
33 
Definition: property.hpp:11
Definition: PEtypes.h:507
Definition: enum_maker.hpp:46