From c519c9b8daa2b6bece6c63ab69c3ea21a3c58cfe Mon Sep 17 00:00:00 2001 From: Richard Smith Date: Wed, 22 Jul 2015 01:30:58 +0000 Subject: [PATCH] SetVector: add reverse_iterator support. llvm-svn: 242865 --- llvm/include/llvm/ADT/SetVector.h | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/llvm/include/llvm/ADT/SetVector.h b/llvm/include/llvm/ADT/SetVector.h index a7fd408..2125b27 100644 --- a/llvm/include/llvm/ADT/SetVector.h +++ b/llvm/include/llvm/ADT/SetVector.h @@ -44,6 +44,8 @@ public: typedef Vector vector_type; typedef typename vector_type::const_iterator iterator; typedef typename vector_type::const_iterator const_iterator; + typedef typename vector_type::const_reverse_iterator reverse_iterator; + typedef typename vector_type::const_reverse_iterator const_reverse_iterator; typedef typename vector_type::size_type size_type; /// \brief Construct an empty SetVector @@ -85,6 +87,26 @@ public: return vector_.end(); } + /// \brief Get an reverse_iterator to the end of the SetVector. + reverse_iterator rbegin() { + return vector_.rbegin(); + } + + /// \brief Get a const_reverse_iterator to the end of the SetVector. + const_reverse_iterator rbegin() const { + return vector_.rbegin(); + } + + /// \brief Get a reverse_iterator to the beginning of the SetVector. + reverse_iterator rend() { + return vector_.rend(); + } + + /// \brief Get a const_reverse_iterator to the beginning of the SetVector. + const_reverse_iterator rend() const { + return vector_.rend(); + } + /// \brief Return the last element of the SetVector. const T &back() const { assert(!empty() && "Cannot call back() on empty SetVector!"); -- 2.7.4