**For an "output-only" value:** Prefer return values to output parameters.
This includes large objects like standard containers that use implicit move operations for performance and to avoid explicit memory management.
This includes large objects like standard containers that use implicit move operations for performance and to avoid explicit memory management. A return value is harder to miss and harder to misuse than a `T&` (an in-out parameter).
If you have multiple values to return, [use a tuple](#Rf-T-multi) or similar multi-member type.
##### Example
vector<constint*> find_all(const vector<int>&, int x); // return pointers to elements with the value x
vector<constint*> find_all(const vector<int>&, int x); // OK: return pointers to elements with the value x
##### Example, bad
void find_all(const vector<int>&, vector<constint*>& out, int x); // Bad: place pointers to elements with value x in out
void find_all(const vector<int>&, vector<constint*>& out, int x); // place pointers to elements with value x in out
##### Note
A struct of many (individually cheap-to-move) elements may be in aggregate expensive to move.
##### Exceptions
@ -2213,6 +2214,20 @@ If you have multiple values to return, [use a tuple](#Rf-T-multi) or similar mul
* If a type is expensive to move (e.g., `array<BigPOD>`), consider allocating it on the free store and return a handle (e.g., `unique_ptr`), or passing it in a non-`const` reference to a target object to fill (to be used as an out-parameter).
* In the special case of allowing a caller to reuse an object that carries capacity (e.g., `std::string`, `std::vector`) across multiple calls to the function in an inner loop, treat it as an in/out parameter instead and pass by `&`. This is one use of the more generally named "caller-allocated out" pattern.