This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
Re: [PATCH] PR libstdc++/79206 check string_view sizes in operator==
- From: Ville Voutilainen <ville dot voutilainen at gmail dot com>
- To: Jonathan Wakely <jwakely at redhat dot com>
- Cc: "libstdc++" <libstdc++ at gcc dot gnu dot org>, "gcc-patches at gcc dot gnu dot org" <gcc-patches at gcc dot gnu dot org>
- Date: Tue, 24 Jan 2017 16:46:21 +0200
- Subject: Re: [PATCH] PR libstdc++/79206 check string_view sizes in operator==
- Authentication-results: sourceware.org; auth=none
- References: <20170124120542.GA10349@redhat.com> <CAFk2RUbbTDQA9fsErya3Eoe9xSQMh6-bz6QkR=hhZCuAnixtbA@mail.gmail.com> <20170124141628.GE3093@redhat.com>
On 24 January 2017 at 16:16, Jonathan Wakely <jwakely@redhat.com> wrote:
>> We do want it for basic_string as well, I think. And while I doubt
>> your interpretation
>> of the standard is pedantically correct, I also think that the
>> standard is broken if it
>> doesn't allow this optimization, and the standard should be fixed in that
>> case.
> But I think fixing this for std::basic_string should wait for stage 1.
> The basic_string_view fix I committed only touches TS & C++17 stuff.
Release-management-wise I can't disagree with postponing the
basic_string change. However, I must
say that an implementation that doesn't check the sizes before
potentially comparing megabytes+10 bytes
of data just to then say that the strings are not equal because it
found a difference at megabytes+1
is seriously problematic, and we should seriously entertain the idea
of just changing it and fixing the
standard later.