fork download
  1. #include <iostream>
  2. #include <vector>
  3. using namespace std;
  4.  
  5. vector<int> gv;
  6.  
  7. void setSelectedDfsOfDfSet(const vector<int> &Dfs)
  8. {
  9. cout << "Copy\n";
  10. //m_vSelectedDfccIdxListOfDFset = selectedDfs;
  11. gv = Dfs;
  12. }
  13.  
  14. void setSelectedDfsOfDfSet(vector<int> &&Dfs)
  15. {
  16. // vector<int> v;
  17. cout << "Move\n";
  18. //m_vSelectedDfccIdxListOfDFset = selectedDfs;
  19. gv = Dfs;
  20. }
  21.  
  22. vector<int> Foo()
  23. {
  24. vector<int> v;
  25. v.push_back(1);
  26. v.push_back(2);
  27. return v;
  28. }
  29.  
  30.  
  31. int main() {
  32. setSelectedDfsOfDfSet(Foo());
  33. cout << "GV: " << "\n";
  34. for (auto& i : gv) {
  35. cout << i << "\n";
  36. }
  37. return 0;
  38. }
Success #stdin #stdout 0.01s 5288KB
stdin
Standard input is empty
stdout
Move
GV: 
1
2