This is the mail archive of the
mailing list for the GCC project.
Re: [v3] Less noexcept
- From: Paolo Carlini <paolo dot carlini at oracle dot com>
- To: Marc Glisse <marc dot glisse at inria dot fr>
- Cc: libstdc++ at gcc dot gnu dot org, gcc-patches at gcc dot gnu dot org
- Date: Mon, 23 Sep 2013 15:13:08 -0500
- Subject: Re: [v3] Less noexcept
- Authentication-results: sourceware.org; auth=none
- References: <alpine dot DEB dot 2 dot 10 dot 1309231727470 dot 4526 at stedding dot saclay dot inria dot fr> <52406C81 dot 3010106 at oracle dot com> <alpine dot DEB dot 2 dot 10 dot 1309231947130 dot 4088 at laptop-mg dot saclay dot inria dot fr> <52409856 dot 1000902 at oracle dot com>
Well, I have a second (practical) thought about this part. If you are
willing to spend a little more time on this, and can confirm your
preliminary analysis about copy-constructor vs move-constructor, first
blush it definitely makes sense to me, I'm certainly not against your
proposal of having the move-constructor identical to the
copy-constructor in that case. In 4.9.x some targets, not Linux, would
benefit from it.
It is funny that with fully dynamic strings, the copy constructor is
"better" than the move constructor: faster, doesn't throw, etc. I
think we should remove the move constructor in that case, or at least
make it act the same as the copy constructor. I didn't mark the copy
constructor as noexcept, but without checking the code it seems
likely we could.
We could, but in my opinion fiddling with those isn't worth the
trouble, because the whole "fully dynamic string" thing is just a
workaround for issues of the current reference counted implementation
vs the statically allocated empty string on some targets.