numbered.hpp
Go to the documentation of this file.
1 
2 // NO INCLUDE GUARDS, THE HEADER IS INTENDED FOR MULTIPLE INCLUSION
3 
4 #if defined(BOOST_PP_IS_ITERATING)
5 
6 // Copyright Aleksey Gurtovoy 2000-2004
7 //
8 // Distributed under the Boost Software License, Version 1.0.
9 // (See accompanying file LICENSE_1_0.txt or copy at
10 // http://www.boost.org/LICENSE_1_0.txt)
11 //
12 // See http://www.boost.org/libs/mpl for documentation.
13 
14 // $Id: numbered.hpp 13472 2017-08-22 07:53:44Z richean $
15 // $Date: 2017-08-22 09:53:44 +0200 (Di, 22 Aug 2017) $
16 // $Revision: 13472 $
17 
24 
25 #define i_ BOOST_PP_FRAME_ITERATION(1)
26 
27 #if defined(BOOST_MPL_CFG_TYPEOF_BASED_SEQUENCES)
28 
29 # define AUX778076_VECTOR_TAIL(vector, i_, T) \
30  BOOST_PP_CAT(vector,i_)< \
31  BOOST_PP_ENUM_PARAMS(i_, T) \
32  > \
33 
34 
35 #if i_ > 0
36 template<
37  BOOST_PP_ENUM_PARAMS(i_, typename T)
38  >
39 struct BOOST_PP_CAT(vector,i_)
40  : v_item<
41  BOOST_PP_CAT(T,BOOST_PP_DEC(i_))
42  , AUX778076_VECTOR_TAIL(vector,BOOST_PP_DEC(i_),T)
43  >
44 {
45  typedef BOOST_PP_CAT(vector,i_) type;
46 };
47 #endif
48 
49 # undef AUX778076_VECTOR_TAIL
50 
51 #else // "brute force" implementation
52 
53 # if i_ > 0
54 
55 template<
56  BOOST_PP_ENUM_PARAMS(i_, typename T)
57  >
58 struct BOOST_PP_CAT(vector,i_)
59 {
60  typedef aux::vector_tag<i_> tag;
61  typedef BOOST_PP_CAT(vector,i_) type;
62 
63 # define AUX778076_VECTOR_ITEM(unused, i_, unused2) \
64  typedef BOOST_PP_CAT(T,i_) BOOST_PP_CAT(item,i_); \
65 
66 
67  BOOST_PP_REPEAT(i_, AUX778076_VECTOR_ITEM, unused)
68 # undef AUX778076_VECTOR_ITEM
69  typedef void_ BOOST_PP_CAT(item,i_);
70  typedef BOOST_PP_CAT(T,BOOST_PP_DEC(i_)) back;
71 
72  // Borland forces us to use 'type' here (instead of the class name)
73  typedef v_iter<type,0> begin;
74  typedef v_iter<type,i_> end;
75 };
76 
77 template<>
78 struct push_front_impl< aux::vector_tag<BOOST_PP_DEC(i_)> >
79 {
80  template< typename Vector, typename T > struct apply
81  {
82  typedef BOOST_PP_CAT(vector,i_)<
83  T
85  BOOST_PP_ENUM_PARAMS(BOOST_PP_DEC(i_), typename Vector::item)
86  > type;
87  };
88 };
89 
90 template<>
91 struct pop_front_impl< aux::vector_tag<i_> >
92 {
93  template< typename Vector > struct apply
94  {
95  typedef BOOST_PP_CAT(vector,BOOST_PP_DEC(i_))<
96  BOOST_PP_ENUM_SHIFTED_PARAMS(i_, typename Vector::item)
97  > type;
98  };
99 };
100 
101 
102 template<>
103 struct push_back_impl< aux::vector_tag<BOOST_PP_DEC(i_)> >
104 {
105  template< typename Vector, typename T > struct apply
106  {
107  typedef BOOST_PP_CAT(vector,i_)<
108  BOOST_PP_ENUM_PARAMS(BOOST_PP_DEC(i_), typename Vector::item)
110  T
111  > type;
112  };
113 };
114 
115 template<>
116 struct pop_back_impl< aux::vector_tag<i_> >
117 {
118  template< typename Vector > struct apply
119  {
120  typedef BOOST_PP_CAT(vector,BOOST_PP_DEC(i_))<
121  BOOST_PP_ENUM_PARAMS(BOOST_PP_DEC(i_), typename Vector::item)
122  > type;
123  };
124 };
125 
126 # endif // i_ > 0
127 
128 # if !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) \
129  && !defined(BOOST_MPL_CFG_NO_NONTYPE_TEMPLATE_PARTIAL_SPEC)
130 
131 template< typename V >
132 struct v_at<V,i_>
133 {
134  typedef typename V::BOOST_PP_CAT(item,i_) type;
135 };
136 
137 # else
138 
139 namespace aux {
140 template<> struct v_at_impl<i_>
141 {
142  template< typename V_ > struct result_
143  {
144  typedef typename V_::BOOST_PP_CAT(item,i_) type;
145  };
146 };
147 }
148 
149 template<>
150 struct at_impl< aux::vector_tag<i_> >
151 {
152  template< typename V_, typename N > struct apply
153  {
154  typedef typename aux::v_at_impl<BOOST_MPL_AUX_VALUE_WKND(N)::value>
155  ::template result_<V_>::type type;
156  };
157 };
158 
159 #if i_ > 0
160 template<>
161 struct front_impl< aux::vector_tag<i_> >
162 {
163  template< typename Vector > struct apply
164  {
165  typedef typename Vector::item0 type;
166  };
167 };
168 
169 template<>
170 struct back_impl< aux::vector_tag<i_> >
171 {
172  template< typename Vector > struct apply
173  {
174  typedef typename Vector::back type;
175  };
176 };
177 
178 template<>
179 struct empty_impl< aux::vector_tag<i_> >
180 {
181  template< typename Vector > struct apply
182  : false_
183  {
184  };
185 };
186 #endif
187 
188 template<>
189 struct size_impl< aux::vector_tag<i_> >
190 {
191  template< typename Vector > struct apply
192  : long_<i_>
193  {
194  };
195 };
196 
197 template<>
198 struct O1_size_impl< aux::vector_tag<i_> >
199  : size_impl< aux::vector_tag<i_> >
200 {
201 };
202 
203 template<>
204 struct clear_impl< aux::vector_tag<i_> >
205 {
206  template< typename Vector > struct apply
207  {
208  typedef vector0<> type;
209  };
210 };
211 
212 # endif // BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
213 
214 #endif // BOOST_MPL_CFG_TYPEOF_BASED_SEQUENCES
215 
216 #undef i_
217 
218 #endif // BOOST_PP_IS_ITERATING
BOOST_PP_CAT
struct BOOST_PP_CAT(AUX778076_COUNT_ARGS_PREFIX, _count_args)
Definition: count_args.hpp:86
long_
Definition: long_fwd.hpp:22
void_
Definition: void.hpp:29
T
T
Definition: mem_fn_cc.hpp:25
template
string template
cat.hpp
boost::foreach_detail_::begin
auto_any< BOOST_DEDUCED_TYPENAME foreach_iterator< T, C >::type > begin(auto_any_t col, type2type< T, C > *, boost::mpl::true_ *)
Definition: foreach.hpp:660
BOOST_PP_DEC
#define BOOST_PP_DEC(x)
Definition: arithmetic/dec.hpp:24
boost::foreach_detail_::end
auto_any< BOOST_DEDUCED_TYPENAME foreach_iterator< T, C >::type > end(auto_any_t col, type2type< T, C > *, boost::mpl::true_ *)
Definition: foreach.hpp:700
boost::foreach::tag
boost_foreach_argument_dependent_lookup_hack tag
Definition: foreach_fwd.hpp:31
comma_if.hpp
BOOST_PP_REPEAT
#define BOOST_PP_REPEAT
Definition: preprocessor/repetition/repeat.hpp:29
BOOST_PP_ENUM_PARAMS
#define BOOST_PP_ENUM_PARAMS(count, param)
Definition: repetition/enum_params.hpp:26
BOOST_PP_COMMA_IF
#define BOOST_PP_COMMA_IF(cond)
Definition: punctuation/comma_if.hpp:27
boost::iterators::V
V
Definition: iterator_facade.hpp:955
enum_params.hpp
boost::mpl::vector0<>
repeat.hpp
dec.hpp
bool_< false >
enum_shifted_params.hpp
BOOST_MPL_AUX_VALUE_WKND
#define BOOST_MPL_AUX_VALUE_WKND(C)
Definition: value_wknd.hpp:57
BOOST_PP_ENUM_SHIFTED_PARAMS
#define BOOST_PP_ENUM_SHIFTED_PARAMS(count, param)
Definition: repetition/enum_shifted_params.hpp:29


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