Предлагаю обсудить плюсы и минусы такой передачи вектора в C++11 (https://ideone.com/8bS0ur)
#include <iostream>
#include <vector>
#include <algorithm>
#include <iterator>
 
class A {
      std::vector<int> y;
public:
      A(){
          y.resize(5,10);
      }
      std::vector<int> f(){
          return std::move(y);
      }
};
 
int main(){
     A a;
     std::vector<int> x(5);
     x = a.f();
     std::copy( x.begin(), x.end(), std::ostream_iterator<int>(std::cout," ")) ;
}
$ c++ -std=c++11 vect.cpp && ./a.out
10 10 10 10 10






