http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55166
Bug #: 55166
Summary: c++11: std::string and =std:move makes swapping
Classification: Unclassified
Product: gcc
Version: 4.7.1
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
AssignedTo: [email protected]
ReportedBy: [email protected]
While moving std::string value to another place g++ makes something different.
std::string t0{"abc"};
std::string t1{"123"};
t0 = std::move(t1); or t0 = static_cast<std::string &&>(t1);
is the same result as
std::swap(t0,t1);