C++ (Qt)struct My{ void method () && {} void method () & {}};
C++ (Qt)struct My{ void rvalueMethod () && {} void lvalueMethod () & {}};
C++ (Qt)::std::make_shared< My >()->lvalueMethod(); // OK::std::make_shared< My >()->rvalueMethod(); // Error
C++ (Qt)#include <memory>#include <iostream> using namespace std; struct A{ void lvalueMethod() & { cout << "lvalueMethod" << endl; } void rvalueMethod() && { cout << "rvalueMethod" << endl; }}; int main(){ make_shared<A>()->lvalueMethod(); move(*make_shared<A>().operator->()).rvalueMethod(); return 0;}
C++ (Qt)template < typename _Value >class Wraper{ _Value m_value;public: _Value * operator -> () & { return &m_value; } // ??? operator -> () && { return ???; }};
C++ (Qt) Wraper< My >()->rvalueMethod();
C++ (Qt)int * a = &3; // Error