If I have the following code, is the vector copied?
std::vector x = y.getTheVector();
or would it depend on whether the return t
std::vector x = y.getTheVector();
Your first example does indeed copy the vector, regardless of whether the "getTheVector" function returns a vector or a reference to a vector.
std::vector& x = y.getTheVector();
In your second example, however, you are creating a reference, so the vector will NOT be copied.