Reputation: 1699
While writing this answer I realized that it's a bit unclear to me how is a move-assignment from a moved-from value to a moved-from value specified in C++ standard library.
As mentioned in that answer, for any MoveAssignable type its fine to perform such a move.
Is it fine to perform such a move for any standard library type with a move assignment operator? What about move-construction from a moved-from object? Is it always valid in the standard library?
I guess it's easier to see that it's valid for types that specify their moved-from state, like e.g. unique_ptr
, but what about those that don't specify it?
In other words, I guess the question would be, is every stdlib type that has a move-ctor MoveContructible, and is every stdlib type that has a move-assign MoveAssignable?
Upvotes: 0
Views: 70