Date: Sun, 19 May 2024 23:39:18 +0200
One disadvantage of naming is, if Func just calls another NRVO-function returning the mutex.
mutex Func()
{
return Func2();
}
mutex Func2()
{
return Func3();
}
mutex Func3()
{
return mutex{};
}
-----Ursprüngliche Nachricht-----
Von:Sebastian Wittmeier <wittmeier_at_[hidden]>
Gesendet:So 19.05.2024 23:30
Betreff:AW: [std-proposals] std::elide
An:std-proposals_at_[hidden];
As each function with NRVO must know, when the to-be-returned object is constructed that it is meant for return (because then it is constructed in the return slot from the caller), it is no limitation to fix the return variable for the whole function.
Received on 2024-05-19 21:39:24