What is a named object?
c++
Solution
A named object is just like it sounds:
someclass foo() {
someclass foo;
foo.member = 42;
return foo;
}
As opposed to:
someclass foo() {
return someclass(42);
}
The latter case is simple to optimize.
Problem
When talking about Return Value Optimisation (RVO), various texts mention exception cases related to the return of Named Objects. So in short: - What are they? - Is there a definition for this term in the current c++ standard? Side note: I've tried to add the following tags: RVO and NRVO but due to lack of reputation points I wasn't able to take this post correctly