3 ms·
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 a
by exitb 4y ago
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.