sl@0: sl@0: #ifndef BOOST_MPL_DISTANCE_HPP_INCLUDED sl@0: #define BOOST_MPL_DISTANCE_HPP_INCLUDED sl@0: sl@0: // Copyright Aleksey Gurtovoy 2000-2004 sl@0: // sl@0: // Distributed under the Boost Software License, Version 1.0. sl@0: // (See accompanying file LICENSE_1_0.txt or copy at sl@0: // http://www.boost.org/LICENSE_1_0.txt) sl@0: // sl@0: // See http://www.boost.org/libs/mpl for documentation. sl@0: sl@0: // $Source: /cvsroot/boost/boost/boost/mpl/distance.hpp,v $ sl@0: // $Date: 2005/01/26 01:58:33 $ sl@0: // $Revision: 1.10 $ sl@0: sl@0: #include sl@0: #include sl@0: #include sl@0: #include sl@0: #include sl@0: #include sl@0: #include sl@0: #include sl@0: #include sl@0: #include sl@0: #include sl@0: #include sl@0: sl@0: sl@0: namespace boost { namespace mpl { sl@0: sl@0: // default implementation for forward/bidirectional iterators sl@0: template< typename Tag > struct distance_impl sl@0: { sl@0: template< typename First, typename Last > struct apply sl@0: #if !defined(BOOST_MPL_CFG_NO_NESTED_FORWARDING) sl@0: : aux::msvc_eti_base< typename iter_fold< sl@0: iterator_range sl@0: , mpl::long_<0> sl@0: , next<> sl@0: >::type > sl@0: { sl@0: #else sl@0: { sl@0: typedef typename iter_fold< sl@0: iterator_range sl@0: , mpl::long_<0> sl@0: , next<> sl@0: >::type type; sl@0: sl@0: BOOST_STATIC_CONSTANT(long, value = sl@0: (iter_fold< sl@0: iterator_range sl@0: , mpl::long_<0> sl@0: , next<> sl@0: >::type::value) sl@0: ); sl@0: #endif sl@0: }; sl@0: }; sl@0: sl@0: template< sl@0: typename BOOST_MPL_AUX_NA_PARAM(First) sl@0: , typename BOOST_MPL_AUX_NA_PARAM(Last) sl@0: > sl@0: struct distance sl@0: : distance_impl< typename tag::type > sl@0: ::template apply sl@0: { sl@0: BOOST_MPL_AUX_LAMBDA_SUPPORT(2, distance, (First, Last)) sl@0: }; sl@0: sl@0: BOOST_MPL_AUX_NA_SPEC(2, distance) sl@0: sl@0: }} sl@0: sl@0: #endif // BOOST_MPL_DISTANCE_HPP_INCLUDED