21 this->m_valid =
false;
43 if(
this != std::addressof(rhs))
59 if(
this != std::addressof(rhs))
80 stream <<
"-- Before entering inner block" <<
endl;
87 ClsObject&& rvalue_ref = std::move(
object);
93 stream <<
"-- After leaving inner block" <<
endl;
94 stream <<
"IMPORTANT - object is still valid in this scope" <<
endl;
95 stream <<
"ClsObject&& rvalue_ref = std::move(object) -- has no effect." <<
endl;
98 stream <<
"\n1. object, lvalue_ref, rvalue_ref are all the same." <<
endl;
99 stream <<
" no copy constructor, no move constructor, no copy assignment, no move assignment" <<
endL;
109 stream <<
"-- Before entering inner block" <<
endl;
116 ClsObject&& rvalue_ref = std::move(
object);
120 ClsObject local_object = std::move(lvalue_ref);
124 stream <<
"-- After leaving inner block" <<
endl;
126 stream <<
"IMPORTANT: object is now invalid at this point" <<
endl;
127 stream <<
"ClsObject local_object = std::move(lvalue_ref) - has serious effect." <<
endl;
130 stream <<
"\n2. object, lvalue_ref, rvalue_ref are all the same." <<
endl;
131 stream <<
" std::move invalidates the original object." <<
endl;
void traits_of_reference_two()
void traits_of_reference_one()
ClsObject & operator=(const ClsObject &rhs)
ClsObject(const ClsObject &)
ClsObject & operator=(ClsObject &&rhs)
ClsObject(ClsObject &&rhs)
Stream output operators << are implemented.