[Bug libstdc++/83981] vector::resize(size_type) should not require T to be CopyInsertable when std=c++14

daniel.kruegler at googlemail dot com gcc-bugzilla@gcc.gnu.org
Thu Jan 25 22:44:00 GMT 2018


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

--- Comment #11 from Daniel Krügler <daniel.kruegler at googlemail dot com> ---
(In reply to Jonathan Wakely from comment #10)
> Perhaps Daniel can comment, since he wrote the resolution of lwg 2033.
> 
> Daniel, if the intent was that vector::resize(size_type) must only move,
> even if that can throw, why is the exception-safety guarantee worded in
> terms of a non-CopyInsertable condition? Was the intention really to forbid
> implementations from giving the strong exception-safety guarantee (by
> copying) if possible?

I'm in the mid of something else, so forgive me if I'm still catching up. The
wording was slightly changed by LWG 2323 later on, does that clarify? [If not,
I can look deeper into it tomorrow evening, so please let me know] The basic
idea that the original wording tried to ensure is that strong exception-safety
holds for non-throwing move-only types or copyable types, because that was the
original intend suggested by Howard Hinnant.


More information about the Gcc-bugs mailing list