...one of the most highly
regarded and expertly designed C++ library projects in the
world.
— Herb Sutter and Andrei
Alexandrescu, C++
Coding Standards
Assignment.
value
& operator=(array
&& arr);
The contents of the value are replaced with the contents of arr
using move semantics:
*arr.storage() == *this->storage()
, ownership of the underlying memory
is transferred in constant time, with no possibility of exceptions.
After assignment, the moved-from array becomes empty with its current
storage pointer.
*arr.storage() != *this->storage()
, an element-wise copy is performed,
which may throw. In this case, the moved-from array is not changed.
Constant, or linear in the size of *this
plus arr.size()
.
Strong guarantee. Calls to memory_resource::allocate
may throw.
Name |
Description |
---|---|
|
The array to move-assign from. |