Skip to content

[libc++][NFC] Use aliases instead of typedefs in std::array #74491

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Dec 5, 2023

Conversation

ldionne
Copy link
Member

@ldionne ldionne commented Dec 5, 2023

As requested in #74482.

@ldionne ldionne requested a review from a team as a code owner December 5, 2023 16:16
@llvmbot llvmbot added the libc++ libc++ C++ Standard Library. Not GNU libstdc++. Not libc++abi. label Dec 5, 2023
@llvmbot
Copy link
Member

llvmbot commented Dec 5, 2023

@llvm/pr-subscribers-libcxx

Author: Louis Dionne (ldionne)

Changes

As requested in #74482.


Full diff: https://github.com/llvm/llvm-project/pull/74491.diff

1 Files Affected:

  • (modified) libcxx/include/array (+12-12)
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];
 

@ldionne ldionne force-pushed the review/use-alias-std-array branch from 64c1005 to 50d960b Compare December 5, 2023 16:20
@ldionne ldionne merged commit 953ac95 into llvm:main Dec 5, 2023
@ldionne ldionne deleted the review/use-alias-std-array branch December 5, 2023 16:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
libc++ libc++ C++ Standard Library. Not GNU libstdc++. Not libc++abi.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants