This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


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.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]