According to this assign doesn't have a r-value overload. The kind of function signature I was expecting is:
basic_string::assign(basic_string::basic_string &¶m);
I checked the implementation for MSVC-2014 and CGI's implementation which do not provide this overload. The obvious advantage of this would be in cases like
string final;
while(true){
string tmp;
// do some operation on tmp
if (ConditionSatisfied){
final.assign(move(tmp));
break;
}
}
// do further operations on final
Is it because the use cases of this would be rare? Or is there is any design flaw to include the overload.