[PATCH] D95611: [ADT][NFC] Add extra typedefs to `ArrayRef` and `MutableArrayRef`
Vladislav Vinogradov via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Fri Feb 26 07:37:10 PST 2021
This revision was automatically updated to reflect the committed changes.
Closed by commit rG9909237d9920: [ADT][NFC] Add extra typedefs to `ArrayRef` and `MutableArrayRef` (authored by vinograd47).
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D95611/new/
https://reviews.llvm.org/D95611
Files:
llvm/include/llvm/ADT/ArrayRef.h
Index: llvm/include/llvm/ADT/ArrayRef.h
===================================================================
--- llvm/include/llvm/ADT/ArrayRef.h
+++ llvm/include/llvm/ADT/ArrayRef.h
@@ -40,10 +40,17 @@
template<typename T>
class LLVM_GSL_POINTER LLVM_NODISCARD ArrayRef {
public:
- using iterator = const T *;
- using const_iterator = const T *;
- using size_type = size_t;
+ using value_type = T;
+ using pointer = value_type *;
+ using const_pointer = const value_type *;
+ using reference = value_type &;
+ using const_reference = const value_type &;
+ using iterator = const_pointer;
+ using const_iterator = const_pointer;
using reverse_iterator = std::reverse_iterator<iterator>;
+ using const_reverse_iterator = std::reverse_iterator<const_iterator>;
+ using size_type = size_t;
+ using difference_type = ptrdiff_t;
private:
/// The start of the array, in an external buffer.
@@ -297,8 +304,17 @@
template<typename T>
class LLVM_NODISCARD MutableArrayRef : public ArrayRef<T> {
public:
- using iterator = T *;
+ using value_type = T;
+ using pointer = value_type *;
+ using const_pointer = const value_type *;
+ using reference = value_type &;
+ using const_reference = const value_type &;
+ using iterator = pointer;
+ using const_iterator = const_pointer;
using reverse_iterator = std::reverse_iterator<iterator>;
+ using const_reverse_iterator = std::reverse_iterator<const_iterator>;
+ using size_type = size_t;
+ using difference_type = ptrdiff_t;
/// Construct an empty MutableArrayRef.
/*implicit*/ MutableArrayRef() = default;
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D95611.326691.patch
Type: text/x-patch
Size: 1664 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210226/5f547a4b/attachment.bin>
More information about the llvm-commits
mailing list