|
|
|
Specifies that an instance of the type can be assigned from anrvalue argument.
The typeT
satisfiesMoveAssignable if
Given
t
, a modifiablelvalue expression of typeT
,rv
, anrvalue expression of typeT
.The following expressions must be valid and have their specified effects.
Expression | Return type | Return value | Post-conditions |
---|---|---|---|
t= rv | T& | t | Ift andrv do not refer to the same object, the value oft is equivalent to the value ofrv before the assignment.The new value of |
The type does not have to implementmove assignment operator in order to satisfy this type requirement: acopy assignment operator that takes its parameter by value or as aconst Type&
, will bind to rvalue argument.
If aMoveAssignable class implements a move assignment operator, it may also implementmove semantics to take advantage of the fact that the value ofrv
after assignment is unspecified.
(C++11)(C++11)(C++11) | checks if a type has a move assignment operator (class template)[edit] |
(C++20) | specifies that a type is assignable from another type (concept)[edit] |