forked from OSchip/llvm-project
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. This re-commits r348301 which was reverted by r348303. The compilation error by gcc 5.4 was resolved using make_tuple in the in the initializer_list. The compileration error by msvc14 was resolved by splitting ZipLongestValueType (which already was a workaround for msvc15) into ZipLongestItemType and ZipLongestTupleType. Differential Revision: https://reviews.llvm.org/D48348 llvm-svn: 348323 |
||
|---|---|---|
| .. | ||
| APFloatTest.cpp | ||
| APIntTest.cpp | ||
| APSIntTest.cpp | ||
| AnyTest.cpp | ||
| ArrayRefTest.cpp | ||
| BitVectorTest.cpp | ||
| BitmaskEnumTest.cpp | ||
| BreadthFirstIteratorTest.cpp | ||
| BumpPtrListTest.cpp | ||
| CMakeLists.txt | ||
| DAGDeltaAlgorithmTest.cpp | ||
| DeltaAlgorithmTest.cpp | ||
| DenseMapTest.cpp | ||
| DenseSetTest.cpp | ||
| DepthFirstIteratorTest.cpp | ||
| EquivalenceClassesTest.cpp | ||
| FoldingSet.cpp | ||
| FunctionExtrasTest.cpp | ||
| FunctionRefTest.cpp | ||
| HashingTest.cpp | ||
| IListBaseTest.cpp | ||
| IListIteratorTest.cpp | ||
| IListNodeBaseTest.cpp | ||
| IListNodeTest.cpp | ||
| IListSentinelTest.cpp | ||
| IListTest.cpp | ||
| ImmutableListTest.cpp | ||
| ImmutableMapTest.cpp | ||
| ImmutableSetTest.cpp | ||
| IntEqClassesTest.cpp | ||
| IntervalMapTest.cpp | ||
| IntrusiveRefCntPtrTest.cpp | ||
| IteratorTest.cpp | ||
| MakeUniqueTest.cpp | ||
| MapVectorTest.cpp | ||
| MappedIteratorTest.cpp | ||
| OptionalTest.cpp | ||
| PackedVectorTest.cpp | ||
| PointerEmbeddedIntTest.cpp | ||
| PointerIntPairTest.cpp | ||
| PointerSumTypeTest.cpp | ||
| PointerUnionTest.cpp | ||
| PostOrderIteratorTest.cpp | ||
| PriorityWorklistTest.cpp | ||
| RangeAdapterTest.cpp | ||
| SCCIteratorTest.cpp | ||
| STLExtrasTest.cpp | ||
| ScopeExitTest.cpp | ||
| SequenceTest.cpp | ||
| SetVectorTest.cpp | ||
| SimpleIListTest.cpp | ||
| SmallPtrSetTest.cpp | ||
| SmallSetTest.cpp | ||
| SmallStringTest.cpp | ||
| SmallVectorTest.cpp | ||
| SparseBitVectorTest.cpp | ||
| SparseMultiSetTest.cpp | ||
| SparseSetTest.cpp | ||
| StatisticTest.cpp | ||
| StringExtrasTest.cpp | ||
| StringMapTest.cpp | ||
| StringRefTest.cpp | ||
| StringSwitchTest.cpp | ||
| TestGraph.h | ||
| TinyPtrVectorTest.cpp | ||
| TripleTest.cpp | ||
| TwineTest.cpp | ||
| VariadicFunctionTest.cpp | ||