Having code
string one = "one";
string two{ one };
string three{ move(one)};
cout << one << endl;
this prints "". It is due to fact that moving constructor for string three is invoked and stole its argument value. However, how come variable one is modified?
When we pass move(one)
rvalue is returned. And move constructor steals resource from THAT rvalue, the variable one is not passed as reference or pointer there. So how come behavior like this happen?
thanks for answers