fork(1) download
  1. #include <iostream>
  2. #include <vector>
  3. #include <algorithm>
  4. #include <iterator>
  5.  
  6. class A {
  7. std::vector<int> y;
  8. public:
  9. A(){
  10. y.resize(5,10);
  11. }
  12. std::vector<int> f(){
  13. return std::move(y);
  14. }
  15. };
  16.  
  17. int main(){
  18. A a;
  19. std::vector<int> x(5);
  20. x = a.f();
  21. std::copy( x.begin(), x.end(), std::ostream_iterator<int>(std::cout," ")) ;
  22. }
  23.  
Success #stdin #stdout 0s 3456KB
stdin
Standard input is empty
stdout
10 10 10 10 10