[libcxx-commits] [libcxx] df942d5 - [libc++][NFC] Use using declaration instead of typedef in string_view
Louis Dionne via libcxx-commits
libcxx-commits at lists.llvm.org
Mon Nov 28 05:04:45 PST 2022
Author: Louis Dionne
Date: 2022-11-28T08:04:09-05:00
New Revision: df942d569243f937413fc3fb4e0d3cf037ff4004
URL: https://github.com/llvm/llvm-project/commit/df942d569243f937413fc3fb4e0d3cf037ff4004
DIFF: https://github.com/llvm/llvm-project/commit/df942d569243f937413fc3fb4e0d3cf037ff4004.diff
LOG: [libc++][NFC] Use using declaration instead of typedef in string_view
Added:
Modified:
libcxx/include/string_view
Removed:
################################################################################
diff --git a/libcxx/include/string_view b/libcxx/include/string_view
index 8f39cdcc23f62..2ee6043eb156a 100644
--- a/libcxx/include/string_view
+++ b/libcxx/include/string_view
@@ -259,18 +259,18 @@ template<class _CharT, class _Traits>
class basic_string_view {
public:
// types
- typedef _Traits traits_type;
- typedef _CharT value_type;
- typedef _CharT* pointer;
- typedef const _CharT* const_pointer;
- typedef _CharT& reference;
- typedef const _CharT& const_reference;
- typedef const_pointer const_iterator; // See [string.view.iterators]
- typedef const_iterator iterator;
- typedef _VSTD::reverse_iterator<const_iterator> const_reverse_iterator;
- typedef const_reverse_iterator reverse_iterator;
- typedef size_t size_type;
- typedef ptr
diff _t
diff erence_type;
+ using traits_type = _Traits;
+ using value_type = _CharT;
+ using pointer = _CharT*;
+ using const_pointer = const _CharT*;
+ using reference = _CharT&;
+ using const_reference = const _CharT&;
+ using const_iterator = const_pointer; // See [string.view.iterators]
+ using iterator = const_iterator;
+ using const_reverse_iterator = _VSTD::reverse_iterator<const_iterator>;
+ using reverse_iterator = const_reverse_iterator;
+ using size_type = size_t;
+ using
diff erence_type = ptr
diff _t;
static _LIBCPP_CONSTEXPR const size_type npos = -1; // size_type(-1);
static_assert((!is_array<value_type>::value), "Character type of basic_string_view must not be an array");
More information about the libcxx-commits
mailing list