...one of the most highly
regarded and expertly designed C++ library projects in the
world.
— Herb Sutter and Andrei
Alexandrescu, C++
Coding Standards
Assign characters to a string.
string
& assign(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 boost::container::pmr::memory_resource
,
otherwise
*other.storage() != *this->storage()
, a copy of the characters in 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 assign from. |