// Copyright Daniel Wallin 2010. 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_VECTOR_100629_HPP # define LUABIND_VECTOR_100629_HPP # ifdef LUABIND_CPP0x # include # include # include # include namespace luabind { // This is used to specify function signatures, both in the user interface and // in the implementation. In the C++03 version this used to be any MPL forward // sequence. For backward compatibility reasons we provide a conversion layer // from an MPL sequence. template struct vector {}; namespace detail { template struct vector_iterator; template struct vector_iterator { typedef Head type; typedef vector_iterator next; }; template <> struct vector_iterator<> {}; } // namespace detail } // namespace luabind namespace boost { namespace mpl { // MPL sequence adaption layer to ease the transition to C++0x. template struct begin > { typedef luabind::detail::vector_iterator type; }; template struct end > { typedef luabind::detail::vector_iterator<> type; }; template struct size > : long_ {}; template struct front > { typedef Head type; }; template struct deref > { typedef Head type; }; }} // namespace boost::mpl # endif // LUABIND_CPP0x namespace luabind { namespace detail { # ifdef LUABIND_CPP0x struct append_vector { template struct apply; template struct apply, T> { typedef vector type; }; }; template struct as_vector : boost::mpl::fold, append_vector> {}; template struct as_vector > { typedef vector type; }; # else // LUABIND_CPP0x template struct as_vector { typedef Sequence type; }; # endif }} // namespace luabind::detail #endif // LUABIND_VECTOR_100629_HPP