OSDN Git Service

Add llvm::enumerate() to STLExtras.
authorZachary Turner <zturner@google.com>
Thu, 29 Sep 2016 22:59:30 +0000 (22:59 +0000)
committerZachary Turner <zturner@google.com>
Thu, 29 Sep 2016 22:59:30 +0000 (22:59 +0000)
commitab82a456ef39cb25d71501f019738ae7ed9e59a7
tree51189890fe464d5e94ee3319c82e2da24edebd52
parent8a50db91a80bb2287be5b80a2de37d6454067f26
Add llvm::enumerate() to STLExtras.

enumerate allows you to iterate over a range by pairing the
iterator's value with its index in the enumeration.  This gives
you most of the benefits of using a for loop while still allowing
the range syntax.

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