fork download
  1. #include <memory>
  2. #include <iostream>
  3. using namespace std;
  4.  
  5. class A
  6. {
  7. public:
  8. A(){}
  9. A(A&&)=delete;
  10. A&& move_me(){return std::move(*this); }
  11. };
  12.  
  13. int main() {
  14.  
  15. A a;
  16.  
  17. A&& rrA = a.move_me();
  18.  
  19. std::cout << "& a" << &a << " -- ok\n";
  20. std::cout << "&rrA" << &rrA << " -- ok\n";
  21. return 0;
  22. }
Success #stdin #stdout 0s 15232KB
stdin
Standard input is empty
stdout
&  a0x7fff2679d2ff -- ok
&rrA0x7fff2679d2ff -- ok