// 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_COPY_POLICY_081021_HPP # define LUABIND_COPY_POLICY_081021_HPP # include namespace luabind { namespace detail { struct copy_converter { template void apply(lua_State* L, T const& x) { value_converter().apply(L, x); } template void apply(lua_State* L, T* x) { if (!x) lua_pushnil(L); else apply(L, *x); } }; template struct copy_policy : conversion_policy { static void precall(lua_State*, index_map const&) {} static void postcall(lua_State*, index_map const&) {} template struct apply { typedef copy_converter type; }; }; } // namespace detail template detail::policy_cons, detail::null_type> copy(LUABIND_PLACEHOLDER_ARG(N)) { return detail::policy_cons, detail::null_type>(); } } // namespace luabind #endif // LUABIND_COPY_POLICY_081021_HPP