5 ms·
>fixing the lifetime of temporaries in range-for loops Could anyone expand on how this was broken?
by devnullbrain 4y ago
>fixing the lifetime of temporaries in range-for loops
Could anyone expand on how this was broken?
- leeter 4y agoThis was not what I thought it was. I assumed it was the `for(auto f : <collection of class>)` issue that STL tried to fix and gave up on. Turns out it was initializers and locks. Extending them to live as long as the loop much like the `if` initializer syntax does for the block. https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p2718r0.html https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p27...