X-Git-Url: http://git.sourceforge.jp/view?a=blobdiff_plain;f=extlib%2Fluabind-0.8%2Fluabind%2Fdetail%2Fproperty.hpp;fp=extlib%2Fluabind-0.8%2Fluabind%2Fdetail%2Fproperty.hpp;h=2c30ce000a32600e9e433d8c5dc49caccadec444;hb=eae4bb750d0c8cc67dbde97f02a4d8666a10161e;hp=0000000000000000000000000000000000000000;hpb=f96ba39e10388c8bd860f6cf43291b3380ce8e36;p=moflib%2Fmoflib.git diff --git a/extlib/luabind-0.8/luabind/detail/property.hpp b/extlib/luabind-0.8/luabind/detail/property.hpp new file mode 100644 index 0000000..2c30ce0 --- /dev/null +++ b/extlib/luabind-0.8/luabind/detail/property.hpp @@ -0,0 +1,33 @@ +// Copyright Daniel Wallin 2008. Use, modification and distribution is +// subject to the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + +#ifndef LUABIND_PROPERTY_081020_HPP +# define LUABIND_PROPERTY_081020_HPP + +namespace luabind { namespace detail { + +template +struct access_member_ptr +{ + access_member_ptr(T Class::* mem_ptr) + : mem_ptr(mem_ptr) + {} + + Result operator()(Class const& x) const + { + return const_cast(x).*mem_ptr; + } + + void operator()(Class& x, T const& value) const + { + x.*mem_ptr = value; + } + + T Class::* mem_ptr; +}; + +}} // namespace luabind::detail + +#endif // LUABIND_PROPERTY_081020_HPP +