]> granicus.if.org Git - llvm/commitdiff
Add front() method to SetVector.
authorJan Sjodin <jan_sjodin@yahoo.com>
Thu, 9 Mar 2017 18:25:07 +0000 (18:25 +0000)
committerJan Sjodin <jan_sjodin@yahoo.com>
Thu, 9 Mar 2017 18:25:07 +0000 (18:25 +0000)
Differential Revision: https://reviews.llvm.org/D27262

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297398 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/ADT/SetVector.h

index 4dc18bc52178fa18f0a26b7019653cab2bf5c26a..220b87983eeb05e98418cbd79373be91ee1be04c 100644 (file)
@@ -119,6 +119,12 @@ public:
     return vector_.rend();
   }
 
+  /// \brief Return the first element of the SetVector.
+  const T &front() const {
+    assert(!empty() && "Cannot call front() on empty SetVector!");
+    return vector_.front();
+  }
+
   /// \brief Return the last element of the SetVector.
   const T &back() const {
     assert(!empty() && "Cannot call back() on empty SetVector!");