[llvm] [ADT] Make Zippy more iterator-like for lifetime safety (PR #112441)
David Blaikie via llvm-commits
llvm-commits at lists.llvm.org
Wed Oct 16 11:24:41 PDT 2024
dwblaikie 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?
Yep, pretty much.
> 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?
Possibly
> 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.
I had some vague sense of that too, but didn't find (admittedly didn't look terribly hard) details on this - do you happen to have pointers to the specifics here?
https://github.com/llvm/llvm-project/pull/112441
More information about the llvm-commits
mailing list