
28 May
2010
28 May
'10
5:32 p.m.
David Abrahams wrote:
I'm talking about the BOOST_COPYABLE_AND_MOVABLE case. Most compilers won't do RVO for code written like "X X::create()".
You are claiming that some aspect of that signature causes RVO not to happen? What aspect?
I was talking about the signature, but about the way "X X::create()" was written: X X::create() { X x; return x; // passing value form static memeber-fn } The expectation that the statement "return x;" will benefit from RVO might not be justified here. Writing "return boost::move(x);" might actually be a good idea. Regards, Thomas