@@ -71,23 +71,6 @@ struct random_access_iterator_tag : public bidirectional_iterator_tag {};
71
71
struct contiguous_iterator_tag : public random_access_iterator_tag {};
72
72
#endif
73
73
74
- template <class _Tp >
75
- struct __has_iterator_typedefs {
76
- private:
77
- template <class _Up >
78
- static false_type __test (...);
79
- template <class _Up >
80
- static true_type
81
- __test (__void_t <typename _Up::iterator_category>* = nullptr ,
82
- __void_t <typename _Up::difference_type>* = nullptr ,
83
- __void_t <typename _Up::value_type>* = nullptr ,
84
- __void_t <typename _Up::reference>* = nullptr ,
85
- __void_t <typename _Up::pointer>* = nullptr );
86
-
87
- public:
88
- static const bool value = decltype (__test<_Tp>(nullptr , nullptr , nullptr , nullptr , nullptr ))::value;
89
- };
90
-
91
74
#if _LIBCPP_STD_VER >= 20
92
75
93
76
// The `cpp17-*-iterator` exposition-only concepts have very similar names to the `Cpp17*Iterator` named requirements
@@ -322,6 +305,23 @@ struct __iterator_traits<_Iter, true>
322
305
is_convertible<typename _Iter::iterator_category, input_iterator_tag>::value ||
323
306
is_convertible<typename _Iter::iterator_category, output_iterator_tag>::value > {};
324
307
308
+ template <class _Tp >
309
+ struct __has_iterator_typedefs {
310
+ private:
311
+ template <class _Up >
312
+ static false_type __test (...);
313
+ template <class _Up >
314
+ static true_type
315
+ __test (__void_t <typename _Up::iterator_category>* = nullptr ,
316
+ __void_t <typename _Up::difference_type>* = nullptr ,
317
+ __void_t <typename _Up::value_type>* = nullptr ,
318
+ __void_t <typename _Up::reference>* = nullptr ,
319
+ __void_t <typename _Up::pointer>* = nullptr );
320
+
321
+ public:
322
+ static const bool value = decltype (__test<_Tp>(nullptr , nullptr , nullptr , nullptr , nullptr ))::value;
323
+ };
324
+
325
325
// iterator_traits<Iterator> will only have the nested types if Iterator::iterator_category
326
326
// exists. Else iterator_traits<Iterator> will be an empty class. This is a
327
327
// conforming extension which allows some programs to compile and behave as
0 commit comments