aboutsummaryrefslogtreecommitdiffstats
path: root/contrib/libs/cxxsupp/libcxxmsvc/.yandex_meta/patches/63-iterator-traits-pointer.patch
blob: 24eaf98abc2a80a4e4fb436532d9b86013b050ff (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
diff --git a/include/__iterator/iterator_traits.h b/include/__iterator/iterator_traits.h
index 6ffb2ab..6ae391b 100644
--- a/include/__iterator/iterator_traits.h
+++ b/include/__iterator/iterator_traits.h
@@ -401,10 +401,11 @@ struct _LIBCPP_TEMPLATE_VIS iterator_traits
 };
 #endif // !defined(_LIBCPP_HAS_NO_CONCEPTS)
 
-template<class _Tp>
+
 #if !defined(_LIBCPP_HAS_NO_CONCEPTS)
+
+template<class _Tp>
 requires is_object_v<_Tp>
-#endif
 struct _LIBCPP_TEMPLATE_VIS iterator_traits<_Tp*>
 {
     typedef ptrdiff_t difference_type;
@@ -417,6 +418,30 @@ struct _LIBCPP_TEMPLATE_VIS iterator_traits<_Tp*>
 #endif
 };
 
+#else // !defined(_LIBCPP_HAS_NO_CONCEPTS)
+
+template <class _Tp, bool is_pointer_to_object>
+struct _LIBCPP_TEMPLATE_VIS __iterator_traits_pointer
+{
+    typedef ptrdiff_t difference_type;
+    typedef typename remove_cv<_Tp>::type value_type;
+    typedef _Tp* pointer;
+    typedef _Tp& reference;
+    typedef random_access_iterator_tag iterator_category;
+#if _LIBCPP_STD_VER > 17
+    typedef contiguous_iterator_tag    iterator_concept;
+#endif
+};
+
+template <class _Tp>
+struct _LIBCPP_TEMPLATE_VIS __iterator_traits_pointer<_Tp, false> {};
+
+template <class _Tp>
+struct _LIBCPP_TEMPLATE_VIS iterator_traits<_Tp*> : public __iterator_traits_pointer<_Tp, is_object<_Tp>::value> {};
+
+#endif // !defined(_LIBCPP_HAS_NO_CONCEPTS)
+
+
 template <class _Tp, class _Up, bool = __has_iterator_category<iterator_traits<_Tp> >::value>
 struct __has_iterator_category_convertible_to
     : is_convertible<typename iterator_traits<_Tp>::iterator_category, _Up>