X-Git-Url: https://git.donarmstrong.com/?p=rsem.git;a=blobdiff_plain;f=boost%2Ffusion%2Fiterator%2Fdistance.hpp;fp=boost%2Ffusion%2Fiterator%2Fdistance.hpp;h=74d2d3ef2f2302629ac14cdd9d3fdd9d96ce5faf;hp=0000000000000000000000000000000000000000;hb=2d71eb92104693ca9baa5a2e1c23eeca776d8fd3;hpb=da57529b92adbb7ae74a89861cb39fb35ac7c62d diff --git a/boost/fusion/iterator/distance.hpp b/boost/fusion/iterator/distance.hpp new file mode 100644 index 0000000..74d2d3e --- /dev/null +++ b/boost/fusion/iterator/distance.hpp @@ -0,0 +1,78 @@ +/*============================================================================= + 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_DISTANCE_09172005_0721) +#define FUSION_DISTANCE_09172005_0721 + +#include +#include + +#include +#include +#include + +#include + +namespace boost { namespace fusion +{ + struct random_access_traversal_tag; + + // Special tags: + struct iterator_facade_tag; // iterator facade tag + struct boost_array_iterator_tag; // boost::array iterator tag + struct mpl_iterator_tag; // mpl sequence iterator tag + struct std_pair_iterator_tag; // std::pair iterator tag + + namespace extension + { + template + struct distance_impl + { + // default implementation + template + struct apply : distance_detail::linear_distance + {}; + }; + + template <> + struct distance_impl + { + template + struct apply : First::template distance {}; + }; + + template <> + struct distance_impl; + + template <> + struct distance_impl; + + template <> + struct distance_impl; + } + + namespace result_of + { + template + struct distance + : extension::distance_impl::type>:: + template apply + { + typedef typename extension::distance_impl::type>:: + template apply::type distance_application; + BOOST_STATIC_CONSTANT(int, value = distance_application::value); + }; + } + + template + inline typename result_of::distance::type + distance(First const& a, Last const& b) + { + return result_of::distance::call(a,b); + } +}} + +#endif