OSDN Git Service

[ADT] Add an early-increment iterator-like type and range adaptor.
authorChandler Carruth <chandlerc@gmail.com>
Sat, 4 Aug 2018 08:17:26 +0000 (08:17 +0000)
committerChandler Carruth <chandlerc@gmail.com>
Sat, 4 Aug 2018 08:17:26 +0000 (08:17 +0000)
commitb2e68027e067b1a1ce5773e4a5e154371dfd948c
treece5484270085c7b980d0d5229573a99ea9b68163
parent30fa583f8430bfc7935bf66b1aab50cfefd6cc11
[ADT] Add an early-increment iterator-like type and range adaptor.

This allows us to model the common LLVM idiom of incrementing
immediately after dereferencing so that we can remove or update the
entity w/o losing our ability to reach the "next".

However, these are not real or proper iterators. They are just enough to
allow range based for loops and very simple range algorithms to work,
but should not be considered full general.

Differential Revision: https://reviews.llvm.org/D49956

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@338955 91177308-0d34-0410-b5e6-96231b3b80d8
include/llvm/ADT/STLExtras.h
unittests/ADT/STLExtrasTest.cpp