...one of the most highly
regarded and expertly designed C++ library projects in the
world.
— Herb Sutter and Andrei
Alexandrescu, C++
Coding Standards
Move assignment.
string& operator=( string&& other);
Replace the contents with those of other
using move semantics.
&other
== this
,
do nothing. Otherwise,
*other.storage() == *this->storage()
, ownership of the underlying memory
is transferred in constant time, with no possibility of exceptions.
After construction, the moved-from string behaves as if newly constructed
with its current memory_resource
. Otherwise,
other
is made. In this case, the moved-from container is not changed.
Constant or linear in other.size()
.
Strong guarantee. Calls to memory_resource::allocate
may throw.
*this
Name |
Description |
---|---|
|
The string to use as a source to move from. |