fork download
  1. #include <string>
  2.  
  3. int main()
  4. {
  5. std::string a = "hello world";
  6.  
  7. std::string().swap(a);
  8. // a.swap(std::string()); -- can't work due to temp
  9. }
  10.  
Success #stdin #stdout 0.01s 2852KB
stdin
Standard input is empty
stdout

Standard output is empty