mpl/vector/aux_/iterator.hpp
Go to the documentation of this file.
1 
2 #ifndef BOOST_MPL_AUX_VECTOR_ITERATOR_HPP_INCLUDED
3 #define BOOST_MPL_AUX_VECTOR_ITERATOR_HPP_INCLUDED
4 
5 // Copyright Aleksey Gurtovoy 2000-2004
6 //
7 // Distributed under the Boost Software License, Version 1.0.
8 // (See accompanying file LICENSE_1_0.txt or copy at
9 // http://www.boost.org/LICENSE_1_0.txt)
10 //
11 // See http://www.boost.org/libs/mpl for documentation.
12 
13 // $Id: iterator.hpp 13472 2017-08-22 07:53:44Z richean $
14 // $Date: 2017-08-22 09:53:44 +0200 (Di, 22 Aug 2017) $
15 // $Revision: 13472 $
16 
19 #include <boost/mpl/plus.hpp>
20 #include <boost/mpl/minus.hpp>
23 #include <boost/mpl/next.hpp>
24 #include <boost/mpl/prior.hpp>
29 
30 namespace boost { namespace mpl {
31 
32 template<
33  typename Vector
34  , BOOST_MPL_AUX_NTTP_DECL(long, n_)
35  >
36 struct v_iter
37 {
38  typedef aux::v_iter_tag tag;
40  typedef typename v_at<Vector,n_>::type type;
41 
42  typedef Vector vector_;
43  typedef mpl::long_<n_> pos;
44 
45 #if defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION)
46  enum {
47  next_ = n_ + 1
48  , prior_ = n_ - 1
49  , pos_ = n_
50  };
51 
52  typedef v_iter<Vector,next_> next;
54 #endif
55 
56 };
57 
58 
59 #if !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION)
60 
61 template<
62  typename Vector
63  , BOOST_MPL_AUX_NTTP_DECL(long, n_)
64  >
65 struct next< v_iter<Vector,n_> >
66 {
67  typedef v_iter<Vector,(n_ + 1)> type;
68 };
69 
70 template<
71  typename Vector
72  , BOOST_MPL_AUX_NTTP_DECL(long, n_)
73  >
74 struct prior< v_iter<Vector,n_> >
75 {
76  typedef v_iter<Vector,(n_ - 1)> type;
77 };
78 
79 template<
80  typename Vector
81  , BOOST_MPL_AUX_NTTP_DECL(long, n_)
82  , typename Distance
83  >
84 struct advance< v_iter<Vector,n_>,Distance>
85 {
86  typedef v_iter<
87  Vector
88  , (n_ + BOOST_MPL_AUX_NESTED_VALUE_WKND(long, Distance))
89  > type;
90 };
91 
92 template<
93  typename Vector
94  , BOOST_MPL_AUX_NTTP_DECL(long, n_)
95  , BOOST_MPL_AUX_NTTP_DECL(long, m_)
96  >
97 struct distance< v_iter<Vector,n_>, v_iter<Vector,m_> >
98  : mpl::long_<(m_ - n_)>
99 {
100 };
101 
102 #else // BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
103 
104 template<> struct advance_impl<aux::v_iter_tag>
105 {
106  template< typename Iterator, typename N > struct apply
107  {
108  enum { pos_ = Iterator::pos_, n_ = N::value };
109  typedef v_iter<
110  typename Iterator::vector_
111  , (pos_ + n_)
112  > type;
113  };
114 };
115 
116 template<> struct distance_impl<aux::v_iter_tag>
117 {
118  template< typename Iter1, typename Iter2 > struct apply
119  {
120  enum { pos1_ = Iter1::pos_, pos2_ = Iter2::pos_ };
121  typedef long_<( pos2_ - pos1_ )> type;
122  BOOST_STATIC_CONSTANT(long, value = ( pos2_ - pos1_ ));
123  };
124 };
125 
126 #endif
127 
128 }}
129 
130 #endif // BOOST_MPL_AUX_VECTOR_ITERATOR_HPP_INCLUDED
long_
Definition: long_fwd.hpp:22
BOOST_STATIC_CONSTANT
#define BOOST_STATIC_CONSTANT(type, assignment)
Definition: suffix.hpp:394
boost::mpl::advance_impl
Definition: advance.hpp:34
ctps.hpp
BOOST_MPL_AUX_NTTP_DECL
#define BOOST_MPL_AUX_NTTP_DECL(T, x)
Definition: nttp_decl.hpp:31
boost::type
Definition: type.hpp:14
value_wknd.hpp
boost
BOOST_MOVE_USE_STANDARD_LIBRARY_MOVE.
BOOST_MPL_AUX_NESTED_VALUE_WKND
#define BOOST_MPL_AUX_NESTED_VALUE_WKND(T, C)
Definition: value_wknd.hpp:67
boost::mpl::v_iter::category
random_access_iterator_tag category
Definition: mpl/vector/aux_/iterator.hpp:39
boost::mpl::v_iter
Definition: mpl/vector/aux_/iterator.hpp:36
workaround.hpp
nttp_decl.hpp
at.hpp
plus.hpp
distance_fwd.hpp
minus.hpp
boost::mpl::v_iter::pos
mpl::long_< n_ > pos
Definition: mpl/vector/aux_/iterator.hpp:43
boost::mpl::apply
primary template (not a specialization!)
Definition: aux_/preprocessed/bcc/apply.hpp:163
iterator_tags.hpp
boost::next
T next(T x)
Definition: next_prior.hpp:146
boost::mpl::v_iter::tag
aux::v_iter_tag tag
Definition: mpl/vector/aux_/iterator.hpp:38
boost::mpl::distance
Definition: distance.hpp:67
next.hpp
boost::mpl::next
Definition: mpl/next_prior.hpp:29
boost::mpl::v_iter::type
v_at< Vector, n_ >::type type
Definition: mpl/vector/aux_/iterator.hpp:40
boost::mpl::prior
Definition: mpl/next_prior.hpp:38
advance_fwd.hpp
boost::prior
T prior(T x)
Definition: next_prior.hpp:155
boost::mpl::random_access_iterator_tag
Definition: iterator_tags.hpp:23
boost::mpl::advance
Definition: advance.hpp:56
boost::mpl::aux::msvc_eti_base< iter_fold< iterator_range< First, Last >, mpl::long_< 0 >, next<> >::type >::type
iter_fold< iterator_range< First, Last >, mpl::long_< 0 >, next<> >::type type
Definition: msvc_eti_base.hpp:61
boost::mpl::v_at
Definition: vector/aux_/at.hpp:62
prior.hpp
boost::mpl::v_iter::vector_
Vector vector_
Definition: mpl/vector/aux_/iterator.hpp:42


sick_visionary_ros
Author(s): SICK AG TechSupport 3D Snapshot
autogenerated on Thu Feb 8 2024 03:40:42