epoc32/include/stdapis/boost/mpl/distance.hpp
branchSymbian2
changeset 2 2fe1408b6811
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/epoc32/include/stdapis/boost/mpl/distance.hpp	Tue Mar 16 16:12:26 2010 +0000
     1.3 @@ -0,0 +1,78 @@
     1.4 +
     1.5 +#ifndef BOOST_MPL_DISTANCE_HPP_INCLUDED
     1.6 +#define BOOST_MPL_DISTANCE_HPP_INCLUDED
     1.7 +
     1.8 +// Copyright Aleksey Gurtovoy 2000-2004
     1.9 +//
    1.10 +// Distributed under the Boost Software License, Version 1.0. 
    1.11 +// (See accompanying file LICENSE_1_0.txt or copy at 
    1.12 +// http://www.boost.org/LICENSE_1_0.txt)
    1.13 +//
    1.14 +// See http://www.boost.org/libs/mpl for documentation.
    1.15 +
    1.16 +// $Source: /cvsroot/boost/boost/boost/mpl/distance.hpp,v $
    1.17 +// $Date: 2005/01/26 01:58:33 $
    1.18 +// $Revision: 1.10 $
    1.19 +
    1.20 +#include <boost/mpl/distance_fwd.hpp>
    1.21 +#include <boost/mpl/iter_fold.hpp>
    1.22 +#include <boost/mpl/iterator_range.hpp>
    1.23 +#include <boost/mpl/long.hpp>
    1.24 +#include <boost/mpl/next.hpp>
    1.25 +#include <boost/mpl/tag.hpp>
    1.26 +#include <boost/mpl/apply_wrap.hpp>
    1.27 +#include <boost/mpl/aux_/msvc_eti_base.hpp>
    1.28 +#include <boost/mpl/aux_/value_wknd.hpp>
    1.29 +#include <boost/mpl/aux_/na_spec.hpp>
    1.30 +#include <boost/mpl/aux_/config/forwarding.hpp>
    1.31 +#include <boost/mpl/aux_/config/static_constant.hpp>
    1.32 +
    1.33 +
    1.34 +namespace boost { namespace mpl {
    1.35 +
    1.36 +// default implementation for forward/bidirectional iterators
    1.37 +template< typename Tag > struct distance_impl
    1.38 +{
    1.39 +    template< typename First, typename Last > struct apply
    1.40 +#if !defined(BOOST_MPL_CFG_NO_NESTED_FORWARDING)
    1.41 +        : aux::msvc_eti_base< typename iter_fold<
    1.42 +              iterator_range<First,Last>
    1.43 +            , mpl::long_<0>
    1.44 +            , next<>
    1.45 +            >::type >
    1.46 +    {
    1.47 +#else
    1.48 +    {
    1.49 +        typedef typename iter_fold<
    1.50 +              iterator_range<First,Last>
    1.51 +            , mpl::long_<0>
    1.52 +            , next<>
    1.53 +            >::type type;
    1.54 +        
    1.55 +        BOOST_STATIC_CONSTANT(long, value =
    1.56 +              (iter_fold<
    1.57 +                  iterator_range<First,Last>
    1.58 +                , mpl::long_<0>
    1.59 +                , next<>
    1.60 +                >::type::value)
    1.61 +            );
    1.62 +#endif
    1.63 +    };
    1.64 +};
    1.65 +
    1.66 +template<
    1.67 +      typename BOOST_MPL_AUX_NA_PARAM(First)
    1.68 +    , typename BOOST_MPL_AUX_NA_PARAM(Last)
    1.69 +    >
    1.70 +struct distance
    1.71 +    : distance_impl< typename tag<First>::type >
    1.72 +        ::template apply<First, Last>
    1.73 +{
    1.74 +    BOOST_MPL_AUX_LAMBDA_SUPPORT(2, distance, (First, Last))
    1.75 +};
    1.76 +
    1.77 +BOOST_MPL_AUX_NA_SPEC(2, distance)
    1.78 +
    1.79 +}}
    1.80 +
    1.81 +#endif // BOOST_MPL_DISTANCE_HPP_INCLUDED