[llvm] [ADT] Make Zippy more iterator-like for lifetime safety (PR #112441)

Jakub Kuderski via llvm-commits llvm-commits at lists.llvm.org
Wed Oct 16 12:32:24 PDT 2024


kuhar wrote:

> Ultimately, this isn't a question of whether the iterator is "valid", it's a question of what usages the iterator supports. Right now, the `zip` iterator doesn't support usages that require `operator*` to return an lvalue, which means it doesn't support being nested inside `concat`. Nothing in C++20 will cause those usages to start working; if you want them to work, you'll need to change the iterator to make them work.

My point is that there are two things we could change: zippy or concat. We could teach concat to support iterators that don't satisfy this requirement and cover more range types in the same sweep as fixing issues with concat of zip.

https://github.com/llvm/llvm-project/pull/112441


More information about the llvm-commits mailing list