This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [v3] More noexcept for vectors
- From: Paolo Carlini <paolo dot carlini at oracle dot com>
- To: libstdc++ at gcc dot gnu dot org
- Cc: Marc Glisse <marc dot glisse at inria dot fr>, gcc-patches at gcc dot gnu dot org
- Date: Mon, 16 Sep 2013 11:27:15 +0200
- 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>
Hi Marc,
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?
Paolo.