[libcxx-commits] [libcxx] [libc++][NFC] Use aliases instead of typedefs in std::array (PR #74491)

Louis Dionne via libcxx-commits libcxx-commits at lists.llvm.org
Tue Dec 5 08:16:34 PST 2023


https://github.com/ldionne created https://github.com/llvm/llvm-project/pull/74491

As requested in https://github.com/llvm/llvm-project/pull/74482.

>From 64c100503c3f3384d722bdd2ce95f9dd026215e8 Mon Sep 17 00:00:00 2001
From: Louis Dionne <ldionne.2 at gmail.com>
Date: Tue, 5 Dec 2023 11:15:55 -0500
Subject: [PATCH] [libc++][NFC] Use aliases instead of typedefs in std::array

---
 libcxx/include/array | 24 ++++++++++++------------
 1 file changed, 12 insertions(+), 12 deletions(-)

diff --git a/libcxx/include/array b/libcxx/include/array
index fc5371ebae21a..b8cd053be5733 100644
--- a/libcxx/include/array
+++ b/libcxx/include/array
@@ -164,18 +164,18 @@ template <class _Tp, size_t _Size>
 struct _LIBCPP_TEMPLATE_VIS array
 {
     // 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 _VSTD::reverse_iterator<iterator>       reverse_iterator;
-    typedef _VSTD::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 iterator               = value_type*;
+    using const_iterator         = const value_type*;
+    using pointer                = value_type*;
+    using const_pointer          = const value_type*;
+    using size_type              = size_t;
+    using difference_type        = ptrdiff_t;
+    using reverse_iterator       = std::reverse_iterator<iterator>;
+    using const_reverse_iterator = std::reverse_iterator<const_iterator>;
 
     _Tp __elems_[_Size];
 



More information about the libcxx-commits mailing list