[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 10:49:02 PDT 2024


kuhar wrote:

OK, so the issue is that the lifetime of objects created by dereferencing zip iterators can be shorter than the iterators themselves? Did I get it right?

> https://godbolt.org/z/aK8drvGvY

Thanks for the repro. Based on the error message, would it be something we could work around with some `if constexpr (is_rvalue_ref_v<...>)` in concat range instead?

I'm asking because IIRC returning values from the deref operator will become valid in C++20, so I wonder if we will have to fix it this way anyway later on.

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


More information about the llvm-commits mailing list