fork(6) download
  1. #include <iostream>
  2. #include <string>
  3.  
  4. using namespace std;
  5.  
  6. class A
  7. {
  8. public:
  9. A() {};
  10. //A( A && other ) : a(std::move(other.a)) {}
  11. std::wstring a;
  12. };
  13.  
  14. int main( int argc, char * argv[] )
  15. {
  16. A a1;
  17. a1.a = L"test";
  18.  
  19. A a2(std::move(a1));
  20. a2.a = L"bob";
  21.  
  22. wcout << a1.a << L" : " << a2.a << endl;
  23.  
  24. return 0;
  25. }
Success #stdin #stdout 0s 3032KB
stdin
Standard input is empty
stdout
test : bob