[libcxx-commits] [libcxx] [libcxx][test] Do not assume array::iterator is a pointer (PR #100603)
nicole mazzuca via libcxx-commits
libcxx-commits at lists.llvm.org
Sat Jul 27 11:18:02 PDT 2024
================
@@ -270,18 +270,23 @@ struct _LIBCPP_TEMPLATE_VIS array {
template <class _Tp>
struct _LIBCPP_TEMPLATE_VIS array<_Tp, 0> {
// types:
- typedef array __self;
- typedef _Tp value_type;
- typedef value_type& reference;
- typedef const value_type& const_reference;
- typedef value_type* iterator;
- typedef const value_type* const_iterator;
- typedef value_type* pointer;
- typedef const value_type* const_pointer;
- typedef size_t size_type;
- typedef ptrdiff_t difference_type;
- typedef std::reverse_iterator<iterator> reverse_iterator;
- typedef std::reverse_iterator<const_iterator> const_reverse_iterator;
+ using __self = array;
+ using value_type = _Tp;
+ using reference = value_type&;
+ using const_reference = const value_type&;
+ using pointer = value_type*;
+ using const_pointer = const value_type*;
+#if defined(_LIBCPP_ABI_USE_WRAP_ITER_IN_STD_ARRAY)
+ using iterator = __wrap_iter<pointer>;
+ using const_iterator = __wrap_iter<const_pointer>;
+#else
+ using iterator = pointer;
+ using const_iterator = const_pointer;
+#endif
----------------
strega-nil wrote:
Sure, I can do that.
https://github.com/llvm/llvm-project/pull/100603
More information about the libcxx-commits
mailing list