/*============================================================================= 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_BEGIN_HPP) #define FUSION_SEQUENCE_BEGIN_HPP #include #include #include namespace boost { namespace fusion { namespace meta { template struct begin_impl { template struct apply { typedef int type; }; }; template struct begin { typedef as_fusion_sequence seq_converter; typedef typename seq_converter::type seq; typedef typename begin_impl:: template apply::type type; }; } #if BOOST_WORKAROUND(BOOST_MSVC,<=1300) namespace detail { template inline typename meta::begin::type begin(Sequence const& seq,mpl::bool_) { typedef meta::begin begin_meta; return meta::begin_impl:: template apply::call( begin_meta::seq_converter::convert_const(seq)); } template inline typename meta::begin::type begin(Sequence& seq,mpl::bool_) { typedef meta::begin begin_meta; return meta::begin_impl:: template apply::call( begin_meta::seq_converter::convert(seq)); } } template inline typename meta::begin::type begin(Sequence& seq) { return detail::begin(seq,is_const()); } #else template inline typename meta::begin::type begin(Sequence const& seq) { typedef meta::begin begin_meta; return meta::begin_impl:: template apply::call( begin_meta::seq_converter::convert_const(seq)); } template inline typename meta::begin::type begin(Sequence& seq) { typedef meta::begin begin_meta; return meta::begin_impl:: template apply::call( begin_meta::seq_converter::convert(seq)); } #endif }} #endif