This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
Re: [v3] More noexcept for vectors
- From: Marc Glisse <marc dot glisse at inria dot fr>
- To: Paolo Carlini <paolo dot carlini at oracle dot com>
- Cc: libstdc++ at gcc dot gnu dot org, gcc-patches at gcc dot gnu dot org
- Date: Mon, 16 Sep 2013 13:13:28 +0200 (CEST)
- Subject: Re: [v3] More noexcept for vectors
- Authentication-results: sourceware.org; auth=none
- References: <alpine dot DEB dot 2 dot 02 dot 1309141228580 dot 9493 at stedding dot saclay dot inria dot fr> <770d7b77-69e8-48ea-a7d4-5a6ca499cf83 at email dot android dot com> <a7b55575-dc1a-4015-8a4c-fc8adcfc941f at email dot android dot com> <alpine dot DEB dot 2 dot 10 dot 1309141716050 dot 10149 at laptop-mg dot saclay dot inria dot fr> <23d2470b-21ca-42fe-8bd1-e95a370f2d65 at email dot android dot com> <alpine dot DEB dot 2 dot 02 dot 1309151042420 dot 30089 at stedding dot saclay dot inria dot fr> <5236CEF3 dot 9000303 at oracle dot com>
- Reply-to: libstdc++ at gcc dot gnu dot org
On Mon, 16 Sep 2013, Paolo Carlini wrote:
On 09/15/2013 11:12 AM, Marc Glisse wrote:
I had to separate the constructor that takes an allocator from the default
constructor in debug/profile, since in release the noexcept only applies to
one of them (and the testsuite asserts that release and debug agree on
this). An alternative would be to make the release vector default
constructor conditionally noexcept (depending on the allocator). Or to use
explicit vector(const Allocator& = Allocator()); also in normal mode
instead of splitting it in two.
Thanks a lot. Now I'm wondering if we shouldn't really do the latter: the
issue is, if I remember correctly, in C++11, at variance with C++98,
allocators aren't necessarily default constructible, thus by explicit
instantiatiation the user can easily tell whether that constructor is split
or not. What do you think?
Shouldn't it just be illegal to explicitly instantiate a full class like
std::vector?
But ok, I'll post that version as soon as I can test it.
--
Marc Glisse