When a function (callee) returns a quantity to the caller function, is it returned by value or by reference?
The thing is I have written a function which builds a ve
It's returned by whatever you declare the return type to be. vector and vector return by value and reference respectively. However, it would be a grave error to return a reference to a local variable in the function as it will have been blown away when the function scope exits.
For good tips on how to efficiently return large vectors from a function, see this question (in fact this one is arguably a duplicate of that).