OSDN Git Service

[SetVector] Add erase() method
authorJun Bum Lim <junbuml@codeaurora.org>
Fri, 25 Mar 2016 16:04:43 +0000 (16:04 +0000)
committerJun Bum Lim <junbuml@codeaurora.org>
Fri, 25 Mar 2016 16:04:43 +0000 (16:04 +0000)
commitc9a0644f8a2670158906416fc27054fbdea1bfd9
tree1a2519f684cd8b0f0b26e93a96e8acd70eadc371
parent4f6a396142548063edb01244f1b6807c0050ec7f
[SetVector] Add erase() method

Summary:
Add erase() which returns an iterator pointing to the next element after the
erased one. This makes it possible to erase selected elements while iterating
over the SetVector :
  while (I != E)
    if (test(*I))
      I = SetVector.erase(I);
    else
      ++I;

Reviewers: qcolombet, mcrosier, MatzeB, dblaikie

Subscribers: dberlin, dblaikie, mcrosier, llvm-commits

Differential Revision: http://reviews.llvm.org/D18281

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@264414 91177308-0d34-0410-b5e6-96231b3b80d8
include/llvm/ADT/SetVector.h
unittests/ADT/CMakeLists.txt
unittests/ADT/SetVectorTest.cpp [new file with mode: 0644]