diff options
| author | Kevin Smith <git@kismith.co.uk> | 2013-01-12 18:41:34 (GMT) | 
|---|---|---|
| committer | Swift Review <review@swift.im> | 2013-01-13 10:36:26 (GMT) | 
| commit | f3bc816af1b0d61452de973963e453bf3b3f95a2 (patch) | |
| tree | e895f8afa3580e6cff6f5ad2017d45bf147a17c2 /3rdParty/Boost/src/boost/fusion/iterator/mpl | |
| parent | 188fc285c6555eadd3c9d50ab8a94adcade78d89 (diff) | |
| download | swift-contrib-f3bc816af1b0d61452de973963e453bf3b3f95a2.zip swift-contrib-f3bc816af1b0d61452de973963e453bf3b3f95a2.tar.bz2  | |
Adding in the spirit Boost stuff
Change-Id: I4f127ce61667243b64081b0aa309028d5077045f
Diffstat (limited to '3rdParty/Boost/src/boost/fusion/iterator/mpl')
| -rw-r--r-- | 3rdParty/Boost/src/boost/fusion/iterator/mpl/convert_iterator.hpp | 58 | ||||
| -rw-r--r-- | 3rdParty/Boost/src/boost/fusion/iterator/mpl/fusion_iterator.hpp | 79 | 
2 files changed, 137 insertions, 0 deletions
diff --git a/3rdParty/Boost/src/boost/fusion/iterator/mpl/convert_iterator.hpp b/3rdParty/Boost/src/boost/fusion/iterator/mpl/convert_iterator.hpp new file mode 100644 index 0000000..dd52d4c --- /dev/null +++ b/3rdParty/Boost/src/boost/fusion/iterator/mpl/convert_iterator.hpp @@ -0,0 +1,58 @@ +/*============================================================================= +    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_CONVERT_ITERATOR_05062005_1218) +#define FUSION_CONVERT_ITERATOR_05062005_1218 + +#include <boost/fusion/support/is_iterator.hpp> +#include <boost/mpl/if.hpp> +#include <boost/mpl/bool.hpp> + +namespace boost { namespace fusion +{ +    template <typename Iterator> +    struct mpl_iterator; // forward declaration + +    //  Test T. If it is a fusion iterator, return a reference to it. +    //  else, assume it is an mpl iterator. + +    template <typename T> +    struct convert_iterator +    { +        typedef typename +            mpl::if_< +                is_fusion_iterator<T> +              , T +              , mpl_iterator<T> +            >::type +        type; + +        static T const& +        call(T const& x, mpl::true_) +        { +            return x; +        } + +        static mpl_iterator<T> +        call(T const& /*x*/, mpl::false_) +        { +            return mpl_iterator<T>(); +        } + +        static typename +            mpl::if_< +                is_fusion_iterator<T> +              , T const& +              , mpl_iterator<T> +            >::type +        call(T const& x) +        { +            return call(x, is_fusion_iterator<T>()); +        } +    }; +}} + +#endif diff --git a/3rdParty/Boost/src/boost/fusion/iterator/mpl/fusion_iterator.hpp b/3rdParty/Boost/src/boost/fusion/iterator/mpl/fusion_iterator.hpp new file mode 100644 index 0000000..82889e0 --- /dev/null +++ b/3rdParty/Boost/src/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 <boost/fusion/iterator/value_of.hpp> +#include <boost/fusion/iterator/next.hpp> +#include <boost/fusion/iterator/prior.hpp> +#include <boost/fusion/iterator/advance.hpp> +#include <boost/fusion/iterator/distance.hpp> +#include <boost/fusion/support/category_of.hpp> +#include <boost/mpl/next_prior.hpp> +#include <boost/mpl/advance_fwd.hpp> +#include <boost/mpl/distance_fwd.hpp> +#include <boost/mpl/iterator_tags.hpp> +#include <boost/mpl/eval_if.hpp> +#include <boost/type_traits/is_base_of.hpp> + +namespace boost { namespace fusion { namespace detail +{ + +template<class Category> +struct to_mpl_category { +    typedef typename mpl::eval_if< +        is_base_of<random_access_traversal_tag, Category>, +        mpl::random_access_iterator_tag, +        mpl::eval_if< +            is_base_of<bidirectional_traversal_tag, Category>, +            mpl::bidirectional_iterator_tag, +            mpl::forward_iterator_tag +        > +    >::type type; +}; + +}}} + +namespace boost { namespace mpl +{ +    template <typename Iterator> +    struct fusion_iterator +    { +        typedef typename fusion::result_of::value_of<Iterator>::type type; +        typedef typename fusion::traits::category_of<Iterator>::type fusion_category; +        typedef typename fusion::detail::to_mpl_category<fusion_category>::type category; +        typedef Iterator iterator; +    }; + +    template <typename Iterator> +    struct next<fusion_iterator<Iterator> > +    { +        typedef fusion_iterator<typename fusion::result_of::next<Iterator>::type> type; +    }; + +    template <typename Iterator> +    struct prior<fusion_iterator<Iterator> > +    { +        typedef fusion_iterator<typename fusion::result_of::prior<Iterator>::type> type; +    }; + +    template <typename Iterator, typename N> +    struct advance<fusion_iterator<Iterator>, N> +    { +        typedef fusion_iterator<typename fusion::result_of::advance<Iterator, N>::type> type; +    }; + +    template <typename First, typename Last> +    struct distance<fusion_iterator<First>, fusion_iterator<Last> > +        : fusion::result_of::distance<First, Last> +    {}; + +}} + +#endif + +  | 
 Swift