News for hackers. Stuff that matters.
Re:Care is needed to use C++ std:optional with non-trivial o... by exitb on Friday January 13, 2023 @08:56AM (#34367725)
I agree that it's complex and overly nuanced. I posted this because the article pointed out a problem, said "be careful", but didn't actually offer any way to address it.

Just z.value() gives you a reference, which, when returned will yield a copy. So no RVO in this case and the move is the next best thing.

There are no comments on this comment yet.