mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-11-23 03:02:36 +01:00
ADT: Implement MutableArrayRef::reverse_iterator
This adds rbegin/rend methods to MutableArrayRef, they will be used by a follow-on commit in clang. llvm-svn: 196768
This commit is contained in:
parent
700f24667b
commit
9f08894a06
@ -185,6 +185,8 @@ namespace llvm {
|
||||
public:
|
||||
typedef T *iterator;
|
||||
|
||||
typedef std::reverse_iterator<iterator> reverse_iterator;
|
||||
|
||||
/// Construct an empty MutableArrayRef.
|
||||
/*implicit*/ MutableArrayRef() : ArrayRef<T>() {}
|
||||
|
||||
@ -219,6 +221,9 @@ namespace llvm {
|
||||
iterator begin() const { return data(); }
|
||||
iterator end() const { return data() + this->size(); }
|
||||
|
||||
reverse_iterator rbegin() const { return reverse_iterator(end()); }
|
||||
reverse_iterator rend() const { return reverse_iterator(begin()); }
|
||||
|
||||
/// front - Get the first element.
|
||||
T &front() const {
|
||||
assert(!this->empty());
|
||||
|
Loading…
Reference in New Issue
Block a user