diff --git a/llvm/include/llvm/ADT/ArrayRef.h b/llvm/include/llvm/ADT/ArrayRef.h --- a/llvm/include/llvm/ADT/ArrayRef.h +++ b/llvm/include/llvm/ADT/ArrayRef.h @@ -40,10 +40,17 @@ template 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 = const 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; + using const_reverse_iterator = std::reverse_iterator; + using size_type = std::size_t; + using difference_type = std::ptrdiff_t; private: /// The start of the array, in an external buffer. @@ -297,8 +304,17 @@ template class LLVM_NODISCARD MutableArrayRef : public ArrayRef { 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; + using const_reverse_iterator = std::reverse_iterator; + using size_type = std::size_t; + using difference_type = std::ptrdiff_t; /// Construct an empty MutableArrayRef. /*implicit*/ MutableArrayRef() = default;