For guaranteed NRVO for more complex types, see also
P2025R2: Guaranteed copy elision for return variables (https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p2025r2.html)
P3375R0: NRVO with factory and after_factory (https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/p3357r0.html)
-----Ursprüngliche Nachricht-----
Von: Tiago Freire via Std-Proposals <std-proposals@lists.isocpp.org>
Gesendet: Sa 15.02.2025 23:43
Betreff: Re: [std-proposals] Delayed const declaration
An: Paul Caprioli <paul@hpkfft.com>; std-proposals@lists.isocpp.org;
CC: Tiago Freire <tmiguelf@hotmail.com>;
Ok, granted my example was a bit simple.
But immediate lambdas are not a solution here.
1. Think of more complex types, and situations where it is not guaranteed NRVO.