This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
Re: RFC: Allow moved-from strings to be non-empty
- From: Marc Glisse <marc dot glisse at inria dot fr>
- To: Ville Voutilainen <ville dot voutilainen at gmail dot com>
- Cc: Jonathan Wakely <jwakely at redhat dot com>, libstdc++ <libstdc++ at gcc dot gnu dot org>, gcc-patches List <gcc-patches at gcc dot gnu dot org>
- Date: Fri, 26 Oct 2018 00:42:53 +0200 (CEST)
- Subject: Re: RFC: Allow moved-from strings to be non-empty
- References: <20181025215349.GA12654@redhat.com> <CAFk2RUYJJSXGZB2fVYebAC-1xgoSRQH99kfmmqK=DksSS02hXw@mail.gmail.com>
- Reply-to: libstdc++ at gcc dot gnu dot org
On Fri, 26 Oct 2018, Ville Voutilainen wrote:
I would rather not introduce a behavioral difference between us and
libc++.
Why not? There are already several, and it helps find bugs. Maybe you
could convince libc++ to change as well if you want to keep the behavior
the same?
It does slightly concern me that some users might
actually semantically expect a moved-from string to be empty, even
though that's not guaranteed, although for non-SSO cases
it *is* guaranteed.
Is it? In debug mode, I'd be tempted to leave the string as "moved" (size
5, short string so there is no allocation).
--
Marc Glisse