mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-10-19 11:02:59 +02:00
63a060a406
Like the already existing zip_shortest/zip_first iterators, zip_longest iterates over multiple iterators at once, but has as many iterations as the longest sequence. This means some iterators may reach the end before others do. zip_longest uses llvm::Optional's None value to mark a past-the-end value. zip_longest is not reverse-iteratable because the tuples iterated over would be different for different length sequences (IMHO for the same reason neither zip_shortest nor zip_first should be reverse-iteratable; one can still reverse the ranges individually if that's the expected behavior). In contrast to zip_shortest/zip_first, zip_longest tuples contain rvalues instead of references. This is because llvm::Optional cannot contain reference types and the value-initialized default does not have a memory location a reference could point to. The motivation for these iterators is to use C++ foreach to compare two lists of ordered attributes in D48100 (SemaOverload.cpp and ASTReaderDecl.cpp). Idea by @hfinkel. Differential Revision: https://reviews.llvm.org/D48348 llvm-svn: 348301 |
||
---|---|---|
.. | ||
ADT | ||
Analysis | ||
AsmParser | ||
BinaryFormat | ||
Bitcode | ||
CodeGen | ||
DebugInfo | ||
Demangle | ||
ExecutionEngine | ||
FuzzMutate | ||
IR | ||
LineEditor | ||
Linker | ||
MC | ||
MI | ||
Object | ||
ObjectYAML | ||
Option | ||
OptRemarks | ||
Passes | ||
ProfileData | ||
Support | ||
Target | ||
TextAPI | ||
tools | ||
Transforms | ||
XRay | ||
CMakeLists.txt | ||
unittest.cfg.in |