First: where are std::move
and std::forward
defined? I know what they do, but I can\'t find proof that any standard header is required to include them
where are std::move and std::forward defined?
std::move
and std::forward
are declared in
. See the synopsis at the beginning of section 20.3[utility].
When implementing move semantics, the source is presumably left in an undefined state.
It of course depends on how you implement the move-constructor and move-assignment operator. If you want to use your objects in standard containers, however, you have to follow the MoveConstructible
and MoveAssignable
concepts, which says that the object remains valid, but is left in unspecified state, i.e. you definitely can destroy it.