Basic facilities
- slide 21 : 42
Value return
The semantics of value return is that of
initialization
The C++ Programming Language
: Page 148
Value return
A copy is returned, initializing an unnamed variable
The copy constructor is used - not the assignment operator
Return of local variables
OK by value
References or pointers to local (automatic) variables should not be returned