/*============================================================================= Copyright (c) 2003 Joel de Guzman Copyright (c) 2004 Peder Holt 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) ==============================================================================*/ #if !defined(FUSION_SEQUENCE_DETAIL_TUPLE_BEGIN_END_TRAITS_HPP) #define FUSION_SEQUENCE_DETAIL_TUPLE_BEGIN_END_TRAITS_HPP #include namespace boost { namespace fusion { struct tuple_tag; template struct tuple_iterator; namespace tuple_detail { template struct begin_traits_impl { typedef tuple_iterator<0, Tuple> type; static type call(Tuple& t); }; template inline typename begin_traits_impl::type begin_traits_impl::call(Tuple& t) { return type(t); } template struct end_traits_impl { typedef typename Tuple::size size; typedef tuple_iterator type; static type call(Tuple& t); }; template inline typename end_traits_impl::type end_traits_impl::call(Tuple& t) { return type(t); } } namespace meta { template struct begin_impl; template <> struct begin_impl { template struct apply : tuple_detail::begin_traits_impl {}; }; template struct end_impl; template <> struct end_impl { template struct apply : tuple_detail::end_traits_impl {}; }; } }} #include #include #include #include #include namespace boost { namespace fusion { namespace meta { template struct generate; template struct push_front; }}} namespace boost { namespace mpl { // these mpl traits really ought to be placed somewhere else template struct begin_impl; template <> struct begin_impl : fusion::meta::begin_impl {}; template struct end_impl; template <> struct end_impl : fusion::meta::end_impl {}; template struct clear_impl; template <> struct clear_impl { template struct apply { typedef fusion::tuple<> type; }; }; template struct push_front_impl; template <> struct push_front_impl { template struct apply { typedef typename fusion::meta::push_front func1_; typedef typename fusion::meta::generate::type type; }; }; }} #endif