In this question discussed When to make a type non-movable in C++11 and I discovered Scott Meyers had similar question on comp.std.c++, where SG listed below class types are not movable in C++11 libeary.
- all mutex types(recursive_mutex , timed_mutex, recursive_timed_mutex,
- condition_variable
- type_info
- error_category
- locale::facet
- random_device
- seed_seq
- reference_wrapper
- duration
- time_point
- – all iterators / iterator adaptors
- ios_base
- basic_istream::sentry
- basic_ostream::sentry
- all atomic types
- once_flag
The question is why is all iterators / iterator adaptors not-movable ?
That post, from a year before the standard was ratified, is outdated. The poster is Daniel Krügler, an active committee member, and it’s a bit of political lobbying:
In other words, all those types being non-movable would be a showstopper bug for the standard, and he wants readers in the Usenet audience to demand that the problem be fixed before the standard becomes official.
The defect has been moved to the “closed” list. The resolution is (link provided for convenience):
Since N3044 is a hefty bit of material, it’s easy to see why it would be essential for such basic functionality to work.
Iterators, and anything else with simple value semantics like
std::durationandstd::time_point, are certainly movable. As others have mentioned, copyability implies movability, and if it didn’t the language would be broken. This post wasn’t wrong at the time; rather it’s arguing about the brokenness of the unfinished language.