59 int&& rvalue_ref = (
int&&)s;
71 stream <<
"The address of rvalue_ref: " << &rvalue_ref <<
endl;
72 stream <<
"The address of lvalue_ref: " << &lvalue_ref <<
endl;
129 stream <<
"Before entering local block" <<
endl;
136 ClsType && rvalue_ref = std::move(
object);
139 ClsType & lvalue_ref = rvalue_ref;
151 stream <<
"After leaving local block" <<
endl;
163 stream <<
"Before Entering the local block" <<
endl;
170 ClsType && obj_ref = std::move(object1);
181 ClsType object2 = std::move(object1);
198 stream <<
"After leaving the local block" <<
endl;
204 ClsType moved_object = std::move(obj);
209 ClsType moved_object = std::move(obj);
void bomb_lurking_in_your_code(ClsType &obj)
void object_life_time_of_const_and_rvalue_ref()
void you_should_be_extra_careful_when_using_std_move()
void test_rvalue_lvalue_reference()
void bomb_lurking_in_your_code_rvalue_ref(ClsType &&obj)
void understand_the_concept_of_ownership()
void you_should_be_extra_careful_when_using_ref_move()
ClsType(const ClsType &rhs)
Stream output operators << are implemented.