1
//-----------------------------------------------------------------------------
2
// boost mpl/distance.hpp header file
3
// See http://www.boost.org for updates, documentation, and revision history.
4
//-----------------------------------------------------------------------------
6
// Copyright (c) 2000-02
9
// Permission to use, copy, modify, distribute and sell this software
10
// and its documentation for any purpose is hereby granted without fee,
11
// provided that the above copyright notice appears in all copies and
12
// that both the copyright notice and this permission notice appear in
13
// supporting documentation. No representations are made about the
14
// suitability of this software for any purpose. It is provided "as is"
15
// without express or implied warranty.
17
#ifndef BOOST_MPL_DISTANCE_HPP_INCLUDED
18
#define BOOST_MPL_DISTANCE_HPP_INCLUDED
20
#include "boost/mpl/aux_/iter_distance.hpp"
21
#include "boost/mpl/aux_/iterator_category.hpp"
22
#include "boost/mpl/iterator_tag.hpp"
23
#include "boost/mpl/iter_fold.hpp"
24
#include "boost/mpl/iterator_range.hpp"
25
#include "boost/mpl/integral_c.hpp"
26
#include "boost/mpl/next.hpp"
27
#include "boost/mpl/aux_/common_name_wknd.hpp"
28
#include "boost/mpl/aux_/void_spec.hpp"
29
#include "boost/config.hpp"
34
BOOST_MPL_AUX_COMMON_NAME_WKND(distance)
36
#if !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION)
40
// forward/bidirectional iterators
41
template< typename Category, typename First, typename Last >
44
iterator_range<First,Last>
51
template< typename First, typename Last >
52
struct distance_impl<ra_iter_tag_,First,Last>
53
: aux::iter_distance<First,Last>
59
BOOST_MPL_AUX_AGLORITHM_NAMESPACE_BEGIN
62
typename BOOST_MPL_AUX_VOID_SPEC_PARAM(First)
63
, typename BOOST_MPL_AUX_VOID_SPEC_PARAM(Last)
67
// agurt, 29/sep/02: Borland doesn't like inheritance here
68
typedef typename aux::distance_impl<
69
typename BOOST_MPL_AUX_ITERATOR_CATEGORY(First)
75
BOOST_MPL_AUX_AGLORITHM_NAMESPACE_END
81
// forward/bidirectional iterators
82
template< typename Category >
85
template< typename First, typename Last > struct result_
87
iterator_range<First,Last>
96
struct distance_impl<ra_iter_tag_>
98
template< typename First, typename Last > struct result_
99
: aux::iter_distance<First,Last>
106
BOOST_MPL_AUX_AGLORITHM_NAMESPACE_BEGIN
109
typename BOOST_MPL_AUX_VOID_SPEC_PARAM(First)
110
, typename BOOST_MPL_AUX_VOID_SPEC_PARAM(Last)
113
#if !defined(BOOST_MSVC) || BOOST_MSVC != 1300
114
: aux::distance_impl< typename BOOST_MPL_AUX_ITERATOR_CATEGORY(First) >
116
: aux::distance_impl< fwd_iter_tag_ >
118
::template result_<First,Last>
122
BOOST_MPL_AUX_AGLORITHM_NAMESPACE_END
124
#endif // BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
126
BOOST_MPL_AUX_ALGORITHM_VOID_SPEC(2, distance)
131
#endif // BOOST_MPL_DISTANCE_HPP_INCLUDED