Skip to content

Commit

Permalink
Add front() method to SetVector.
Browse files Browse the repository at this point in the history
Differential Revision: https://reviews.llvm.org/D27262

llvm-svn: 297398
  • Loading branch information
jsjodin committed Mar 9, 2017
1 parent 2b4917f commit cc36734
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions llvm/include/llvm/ADT/SetVector.h
Expand Up @@ -119,6 +119,12 @@ class SetVector {
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!");
Expand Down

0 comments on commit cc36734

Please sign in to comment.