fork(15) download
  1. #include <algorithm>
  2. #include <iostream>
  3. #include <string>
  4. #include <vector>
  5.  
  6. int main()
  7. {
  8. std::vector<std::string> one{"cat", "dog", "newt"};
  9. std::vector<std::string> two;
  10.  
  11. std::move(begin(one), end(one), back_inserter(two));
  12.  
  13. std::cout << "one:\n";
  14. for (auto& str : one) {
  15. std::cout << str << '\n';
  16. }
  17.  
  18. std::cout << "two:\n";
  19. for (auto& str : two) {
  20. std::cout << str << '\n';
  21. }
  22. }
  23.  
Success #stdin #stdout 0s 3476KB
stdin
Standard input is empty
stdout
one:



two:
cat
dog
newt