
26 Aug
2009
26 Aug
'09
5:09 p.m.
Thomas Klimpel wrote:
The article explains "copy elision" and RVO, and hence explains why taking argument by value is closely related to rvalue-ness.
Saying that perfect forwarding doesn't work because the compiler can't do an optional copy elision anymore when you forward a value seems a bit far-fatched, especially since the pattern where you can exploit it is quite specific. (I've never found a reason to pass arguments by value outside of the assignment operator)
So it shows why the statement "..., but since C++03 can't officially detect rvalue-ness anyway that's irrelevant" is not the complete truth.
Notice the "officially" in the sentence.