[Bug libstdc++/80579] std::vector<T>::reserve should not require T to be moveable.

ville.voutilainen at gmail dot com gcc-bugzilla@gcc.gnu.org
Sun Apr 30 22:10:00 GMT 2017


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80579

--- Comment #4 from Ville Voutilainen <ville.voutilainen at gmail dot com> ---
(In reply to Marc Glisse from comment #2)
> If I remember correctly (very doubtful), a paper was presented about option
> 2, and option 1 was rejected (although we could still provide it as an
> extension if someone provides a patch and it is clean enough that
> maintainers don't feel this will complicate maintenance).

The only semi-clean way to do it requires if constexpr and therefore C++17.
While we have on some occasions made effort to support types with deleted move
operations, the committee is strongly recommending that we shouldn't.

As far as Carlo's actual use case goes, std::atomics don't go into vectors
by design, because vector may shuffle things around and such shuffling is
not an atomic operation.


More information about the Gcc-bugs mailing list