Talk:Return value optimization

From Cppwiki

Jump to: navigation, search

There is a mistake here

The line

foo f = bar(5, 7);

does not create 'f' using foo's default constructor and it does not use the assignment operator. That line is equivalent to the following:

foo f(bar(5, 7));

whenever foo's copy constructor is not explicit (otherwise it's an error). Section 12.2 of the 2003 standard provides a very similar example that mentions this.

--Yuyo 13:48, 25 June 2007 (UTC)

Personal tools