fork download
  1. #include <iostream>
  2. #include <vector>
  3. #include <type_traits>
  4.  
  5. struct S
  6. {
  7. S()
  8. {
  9. std::cout << __PRETTY_FUNCTION__ << '\n';
  10. }
  11.  
  12. S(const S&) = delete;
  13.  
  14. S(S&&)
  15. {
  16. std::cout << __PRETTY_FUNCTION__ << '\n';
  17. }
  18. };
  19.  
  20. int main()
  21. {
  22. std::vector<S> s1(1);
  23.  
  24. std::vector<S> s2;
  25. s2.push_back(std::move(s1[0]));
  26. }
Success #stdin #stdout 0s 16064KB
stdin
Standard input is empty
stdout
S::S()
S::S(S&&)