От: | Юрий Жмеренецкий | ICQ 380412032 | |
Дата: | 19.12.08 02:57 | ||
Оценка: | 62 (3) |
MoveConstructible
T t = rv, ... There is no requirement on the value of rv after the
construction.
MoveAssignable
t = rv, ... There is no requirement on the value of rv after the
construction.
Objects stored in these components shall be MoveConstructible and
MoveAssignable.
+...The destructor of T is called the number of times equal to the number of the elements erased, but the
move assignment operator of T is called the number of times equal to the number of elements in the vector after
the erased elements.
DR#276:
...
Rationale:
list, set, multiset, map, multimap are able to store non-Assignables. However, there is some concern about list<T>: although in general there's no reason for T to be Assignable, some implementations of the member functions operator= and assign do rely on that requirement. The LWG does not want to forbid such implementations.
...
In principle we could also relax the "Assignable" requirement for individual vector member functions, such as push_back. However, the LWG did not see great value in such selective relaxation. Doing so would remove implementors' freedom to implement vector::push_back in terms of vector::insert.
T is Swappable if T satisfies the CopyConstructible requirements (Table 33) and the CopyAssignable requirements...
DR#672
...
Proposed resolution:
Change 20.1.1:
T is Swappable if T satisfies the MoveConstructible requirements (Table 34 ) and the MoveAssignable requirements.
...
[ Kona (2007): We like the change to the Swappable requirements to use move semantics...]