test-cxx.cpp 239 B

12345678910111213141516
  1. #include <iostream>
  2. #include <memory>
  3. static void print_str(std::string s)
  4. {
  5. std::cout << s << std::endl;
  6. }
  7. int main()
  8. {
  9. std::string s("Hello World!");
  10. print_str(std::move(s));
  11. std::cout << "|" << s << "|" << std::endl;
  12. return 0;
  13. }