fork(3) download
  1. #include <iostream>
  2. #include <vector>
  3. using namespace std;
  4.  
  5. vector<int>&& foo(vector<int>&& a) {
  6. return std::move(a);
  7. }
  8.  
  9. int main() {
  10. const vector<int> v = foo({1,2,3});
  11. for (auto i:v)
  12. {
  13. cout<<i<<" ";
  14. }
  15.  
  16. return 0;
  17. }
  18.  
Success #stdin #stdout 0s 4332KB
stdin
Standard input is empty
stdout
1 2 3