Consider the following code snippet:
list<someClass>& method();
....
list<someClass> test = method();
What will the behavior of this be? Will this code:
Return a reference to the someClass instance returned by return value optimization from method(), and then perform someClass's copy constructor on the reference?
Avoid calling the copy constructor somehow?
Specifically, I have methods that are returning very large lists, and I want to avoid calling copy constructors on each return value.
EDIT: Erm, sorry, code compiles now...