From 1a78a62555be32868418fe52f8e330c9d0f95d5a Mon Sep 17 00:00:00 2001 From: Anas Nashif Date: Tue, 30 Oct 2012 12:57:26 -0700 Subject: Imported Upstream version 1.49.0 --- boost/fusion/iterator/mpl/fusion_iterator.hpp | 79 +++++++++++++++++++++++++++ 1 file changed, 79 insertions(+) create mode 100644 boost/fusion/iterator/mpl/fusion_iterator.hpp (limited to 'boost/fusion/iterator/mpl/fusion_iterator.hpp') diff --git a/boost/fusion/iterator/mpl/fusion_iterator.hpp b/boost/fusion/iterator/mpl/fusion_iterator.hpp new file mode 100644 index 0000000000..82889e0806 --- /dev/null +++ b/boost/fusion/iterator/mpl/fusion_iterator.hpp @@ -0,0 +1,79 @@ +/*============================================================================= + Copyright (c) 2001-2011 Joel de Guzman + + Distributed under 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_FUSION_ITERATOR_10012005_1551) +#define FUSION_FUSION_ITERATOR_10012005_1551 + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +namespace boost { namespace fusion { namespace detail +{ + +template +struct to_mpl_category { + typedef typename mpl::eval_if< + is_base_of, + mpl::random_access_iterator_tag, + mpl::eval_if< + is_base_of, + mpl::bidirectional_iterator_tag, + mpl::forward_iterator_tag + > + >::type type; +}; + +}}} + +namespace boost { namespace mpl +{ + template + struct fusion_iterator + { + typedef typename fusion::result_of::value_of::type type; + typedef typename fusion::traits::category_of::type fusion_category; + typedef typename fusion::detail::to_mpl_category::type category; + typedef Iterator iterator; + }; + + template + struct next > + { + typedef fusion_iterator::type> type; + }; + + template + struct prior > + { + typedef fusion_iterator::type> type; + }; + + template + struct advance, N> + { + typedef fusion_iterator::type> type; + }; + + template + struct distance, fusion_iterator > + : fusion::result_of::distance + {}; + +}} + +#endif + + -- cgit v1.2.3