@@ -25,61 +25,6 @@ _LIBCPP_PUSH_MACROS
25
25
26
26
_LIBCPP_BEGIN_NAMESPACE_STD
27
27
28
- template <class _Iter > class __wrap_iter ;
29
-
30
- template <class _Iter1 , class _Iter2 >
31
- _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_IF_NODEBUG
32
- bool
33
- operator ==(const __wrap_iter<_Iter1>&, const __wrap_iter<_Iter2>&) _NOEXCEPT;
34
-
35
- template <class _Iter1 , class _Iter2 >
36
- _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_IF_NODEBUG
37
- bool
38
- operator <(const __wrap_iter<_Iter1>&, const __wrap_iter<_Iter2>&) _NOEXCEPT;
39
-
40
- template <class _Iter1 , class _Iter2 >
41
- _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_IF_NODEBUG
42
- bool
43
- operator !=(const __wrap_iter<_Iter1>&, const __wrap_iter<_Iter2>&) _NOEXCEPT;
44
-
45
- template <class _Iter1 , class _Iter2 >
46
- _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_IF_NODEBUG
47
- bool
48
- operator >(const __wrap_iter<_Iter1>&, const __wrap_iter<_Iter2>&) _NOEXCEPT;
49
-
50
- template <class _Iter1 , class _Iter2 >
51
- _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_IF_NODEBUG
52
- bool
53
- operator >=(const __wrap_iter<_Iter1>&, const __wrap_iter<_Iter2>&) _NOEXCEPT;
54
-
55
- template <class _Iter1 , class _Iter2 >
56
- _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_IF_NODEBUG
57
- bool
58
- operator <=(const __wrap_iter<_Iter1>&, const __wrap_iter<_Iter2>&) _NOEXCEPT;
59
-
60
- #ifndef _LIBCPP_CXX03_LANG
61
- template <class _Iter1 , class _Iter2 >
62
- _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_IF_NODEBUG
63
- auto
64
- operator -(const __wrap_iter<_Iter1>& __x, const __wrap_iter<_Iter2>& __y) _NOEXCEPT
65
- -> decltype (__x.base() - __y.base());
66
- #else
67
- template <class _Iter1 , class _Iter2 >
68
- _LIBCPP_INLINE_VISIBILITY
69
- typename __wrap_iter<_Iter1>::difference_type
70
- operator -(const __wrap_iter<_Iter1>&, const __wrap_iter<_Iter2>&) _NOEXCEPT;
71
- #endif
72
-
73
- template <class _Iter >
74
- _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_IF_NODEBUG
75
- __wrap_iter<_Iter>
76
- operator +(typename __wrap_iter<_Iter>::difference_type, __wrap_iter<_Iter>) _NOEXCEPT;
77
-
78
- template <class _Ip , class _Op > _Op _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 copy (_Ip, _Ip, _Op);
79
- template <class _B1 , class _B2 > _B2 _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 copy_backward (_B1, _B1, _B2);
80
- template <class _Ip , class _Op > _Op _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 move (_Ip, _Ip, _Op);
81
- template <class _B1 , class _B2 > _B2 _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 move_backward (_B1, _B1, _B2);
82
-
83
28
template <class _Iter >
84
29
class __wrap_iter
85
30
{
@@ -217,80 +162,18 @@ class __wrap_iter
217
162
template <class _CharT , class _Traits , class _Alloc > friend class basic_string ;
218
163
template <class _Tp , class _Alloc > friend class _LIBCPP_TEMPLATE_VIS vector;
219
164
template <class _Tp , size_t > friend class _LIBCPP_TEMPLATE_VIS span;
220
-
221
- template <class _Iter1 , class _Iter2 >
222
- _LIBCPP_CONSTEXPR_IF_NODEBUG friend
223
- bool
224
- operator ==(const __wrap_iter<_Iter1>&, const __wrap_iter<_Iter2>&) _NOEXCEPT;
225
-
226
- template <class _Iter1 , class _Iter2 >
227
- _LIBCPP_CONSTEXPR_IF_NODEBUG friend
228
- bool
229
- operator <(const __wrap_iter<_Iter1>&, const __wrap_iter<_Iter2>&) _NOEXCEPT;
230
-
231
- template <class _Iter1 , class _Iter2 >
232
- _LIBCPP_CONSTEXPR_IF_NODEBUG friend
233
- bool
234
- operator !=(const __wrap_iter<_Iter1>&, const __wrap_iter<_Iter2>&) _NOEXCEPT;
235
-
236
- template <class _Iter1 , class _Iter2 >
237
- _LIBCPP_CONSTEXPR_IF_NODEBUG friend
238
- bool
239
- operator >(const __wrap_iter<_Iter1>&, const __wrap_iter<_Iter2>&) _NOEXCEPT;
240
-
241
- template <class _Iter1 , class _Iter2 >
242
- _LIBCPP_CONSTEXPR_IF_NODEBUG friend
243
- bool
244
- operator >=(const __wrap_iter<_Iter1>&, const __wrap_iter<_Iter2>&) _NOEXCEPT;
245
-
246
- template <class _Iter1 , class _Iter2 >
247
- _LIBCPP_CONSTEXPR_IF_NODEBUG friend
248
- bool
249
- operator <=(const __wrap_iter<_Iter1>&, const __wrap_iter<_Iter2>&) _NOEXCEPT;
250
-
251
- #ifndef _LIBCPP_CXX03_LANG
252
- template <class _Iter1 , class _Iter2 >
253
- _LIBCPP_CONSTEXPR_IF_NODEBUG friend
254
- auto
255
- operator -(const __wrap_iter<_Iter1>& __x, const __wrap_iter<_Iter2>& __y) _NOEXCEPT
256
- -> decltype (__x.base() - __y.base());
257
- #else
258
- template <class _Iter1 , class _Iter2 >
259
- _LIBCPP_CONSTEXPR_IF_NODEBUG friend
260
- typename __wrap_iter<_Iter1>::difference_type
261
- operator -(const __wrap_iter<_Iter1>&, const __wrap_iter<_Iter2>&) _NOEXCEPT;
262
- #endif
263
-
264
- template <class _Iter1 >
265
- _LIBCPP_CONSTEXPR_IF_NODEBUG friend
266
- __wrap_iter<_Iter1>
267
- operator +(typename __wrap_iter<_Iter1>::difference_type, __wrap_iter<_Iter1>) _NOEXCEPT;
268
165
};
269
166
270
- #if _LIBCPP_STD_VER <= 17
271
- template <class _It >
272
- struct __is_cpp17_contiguous_iterator <__wrap_iter<_It> > : true_type {};
273
- #endif
274
-
275
- template <class _Iter >
276
- _LIBCPP_CONSTEXPR
277
- decltype (_VSTD::__to_address(declval<_Iter>()))
278
- __to_address(__wrap_iter<_Iter> __w) _NOEXCEPT {
279
- return _VSTD::__to_address (__w.base ());
280
- }
281
-
282
167
template <class _Iter1 , class _Iter2 >
283
- inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_IF_NODEBUG
284
- bool
285
- operator ==(const __wrap_iter<_Iter1>& __x, const __wrap_iter<_Iter2>& __y) _NOEXCEPT
168
+ _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_IF_NODEBUG
169
+ bool operator ==(const __wrap_iter<_Iter1>& __x, const __wrap_iter<_Iter2>& __y) _NOEXCEPT
286
170
{
287
171
return __x.base () == __y.base ();
288
172
}
289
173
290
174
template <class _Iter1 , class _Iter2 >
291
- inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_IF_NODEBUG
292
- bool
293
- operator <(const __wrap_iter<_Iter1>& __x, const __wrap_iter<_Iter2>& __y) _NOEXCEPT
175
+ _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_IF_NODEBUG
176
+ bool operator <(const __wrap_iter<_Iter1>& __x, const __wrap_iter<_Iter2>& __y) _NOEXCEPT
294
177
{
295
178
#if _LIBCPP_DEBUG_LEVEL == 2
296
179
_LIBCPP_ASSERT (__get_const_db ()->__less_than_comparable (&__x, &__y),
@@ -300,106 +183,70 @@ operator<(const __wrap_iter<_Iter1>& __x, const __wrap_iter<_Iter2>& __y) _NOEXC
300
183
}
301
184
302
185
template <class _Iter1 , class _Iter2 >
303
- inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_IF_NODEBUG
304
- bool
305
- operator !=(const __wrap_iter<_Iter1>& __x, const __wrap_iter<_Iter2>& __y) _NOEXCEPT
186
+ _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_IF_NODEBUG
187
+ bool operator !=(const __wrap_iter<_Iter1>& __x, const __wrap_iter<_Iter2>& __y) _NOEXCEPT
306
188
{
307
189
return !(__x == __y);
308
190
}
309
191
310
192
template <class _Iter1 , class _Iter2 >
311
- inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_IF_NODEBUG
312
- bool
313
- operator >(const __wrap_iter<_Iter1>& __x, const __wrap_iter<_Iter2>& __y) _NOEXCEPT
193
+ _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_IF_NODEBUG
194
+ bool operator >(const __wrap_iter<_Iter1>& __x, const __wrap_iter<_Iter2>& __y) _NOEXCEPT
314
195
{
315
196
return __y < __x;
316
197
}
317
198
318
199
template <class _Iter1 , class _Iter2 >
319
- inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_IF_NODEBUG
320
- bool
321
- operator >=(const __wrap_iter<_Iter1>& __x, const __wrap_iter<_Iter2>& __y) _NOEXCEPT
200
+ _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_IF_NODEBUG
201
+ bool operator >=(const __wrap_iter<_Iter1>& __x, const __wrap_iter<_Iter2>& __y) _NOEXCEPT
322
202
{
323
203
return !(__x < __y);
324
204
}
325
205
326
206
template <class _Iter1 , class _Iter2 >
327
- inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_IF_NODEBUG
328
- bool
329
- operator <=(const __wrap_iter<_Iter1>& __x, const __wrap_iter<_Iter2>& __y) _NOEXCEPT
330
- {
331
- return !(__y < __x);
332
- }
333
-
334
- template <class _Iter1 >
335
- inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_IF_NODEBUG
336
- bool
337
- operator !=(const __wrap_iter<_Iter1>& __x, const __wrap_iter<_Iter1>& __y) _NOEXCEPT
338
- {
339
- return !(__x == __y);
340
- }
341
-
342
- template <class _Iter1 >
343
- inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_IF_NODEBUG
344
- bool
345
- operator >(const __wrap_iter<_Iter1>& __x, const __wrap_iter<_Iter1>& __y) _NOEXCEPT
346
- {
347
- return __y < __x;
348
- }
349
-
350
- template <class _Iter1 >
351
- inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_IF_NODEBUG
352
- bool
353
- operator >=(const __wrap_iter<_Iter1>& __x, const __wrap_iter<_Iter1>& __y) _NOEXCEPT
354
- {
355
- return !(__x < __y);
356
- }
357
-
358
- template <class _Iter1 >
359
- inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_IF_NODEBUG
360
- bool
361
- operator <=(const __wrap_iter<_Iter1>& __x, const __wrap_iter<_Iter1>& __y) _NOEXCEPT
207
+ _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_IF_NODEBUG
208
+ bool operator <=(const __wrap_iter<_Iter1>& __x, const __wrap_iter<_Iter2>& __y) _NOEXCEPT
362
209
{
363
210
return !(__y < __x);
364
211
}
365
212
366
- #ifndef _LIBCPP_CXX03_LANG
367
213
template <class _Iter1 , class _Iter2 >
368
- inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_IF_NODEBUG
369
- auto
370
- operator -(const __wrap_iter<_Iter1>& __x, const __wrap_iter<_Iter2>& __y) _NOEXCEPT
371
- -> decltype (__x.base() - __y.base())
372
- {
373
- #if _LIBCPP_DEBUG_LEVEL == 2
374
- _LIBCPP_ASSERT (__get_const_db ()->__less_than_comparable (&__x, &__y),
375
- " Attempted to subtract incompatible iterators" );
376
- #endif
377
- return __x.base () - __y.base ();
378
- }
214
+ _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_IF_NODEBUG
215
+ #ifndef _LIBCPP_CXX03_LANG
216
+ auto operator -(const __wrap_iter<_Iter1>& __x, const __wrap_iter<_Iter2>& __y) _NOEXCEPT
217
+ -> decltype (__x.base() - __y.base())
379
218
#else
380
- template <class _Iter1 , class _Iter2 >
381
- inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_IF_NODEBUG
382
219
typename __wrap_iter<_Iter1>::difference_type
383
220
operator -(const __wrap_iter<_Iter1>& __x, const __wrap_iter<_Iter2>& __y) _NOEXCEPT
221
+ #endif // C++03
384
222
{
385
223
#if _LIBCPP_DEBUG_LEVEL == 2
386
224
_LIBCPP_ASSERT (__get_const_db ()->__less_than_comparable (&__x, &__y),
387
225
" Attempted to subtract incompatible iterators" );
388
226
#endif
389
227
return __x.base () - __y.base ();
390
228
}
391
- #endif
392
229
393
- template <class _Iter >
394
- inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_IF_NODEBUG
395
- __wrap_iter<_Iter>
396
- operator +(typename __wrap_iter<_Iter>::difference_type __n,
397
- __wrap_iter<_Iter> __x) _NOEXCEPT
230
+ template <class _Iter1 >
231
+ _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_IF_NODEBUG
232
+ __wrap_iter<_Iter1> operator +(typename __wrap_iter<_Iter1>::difference_type __n, __wrap_iter<_Iter1> __x) _NOEXCEPT
398
233
{
399
234
__x += __n;
400
235
return __x;
401
236
}
402
237
238
+ #if _LIBCPP_STD_VER <= 17
239
+ template <class _It >
240
+ struct __is_cpp17_contiguous_iterator <__wrap_iter<_It> > : true_type {};
241
+ #endif
242
+
243
+ template <class _Iter >
244
+ _LIBCPP_CONSTEXPR
245
+ decltype (_VSTD::__to_address(declval<_Iter>()))
246
+ __to_address(__wrap_iter<_Iter> __w) _NOEXCEPT {
247
+ return _VSTD::__to_address (__w.base ());
248
+ }
249
+
403
250
_LIBCPP_END_NAMESPACE_STD
404
251
405
252
_LIBCPP_POP_MACROS
0 commit comments