Return a move-only object from member function
问题 I'm having a difficult time with understand + use move semantics in C++. I have an object Variable implements move constructor and move assignment but no copy constructor and assignment. Generally copying a Variable makes no sense and I want to prohibit copying explicitly. class Variable { public: // ctod/dtor things Variable(Variable&&); Variable& operator =(Variable&&); // ... }; The question is what is correct way of returning a Variable from a function? Variable& UserObject: