[PATCH] libstdc++: implement P3044R2 - sub-string_view from string

Jonathan Wakely jwakely@redhat.com
Fri Nov 21 16:41:20 GMT 2025


On Fri, 21 Nov 2025 at 16:32, Yuao Ma <addr2line@gmail.com> wrote:
>
> On Fri, Nov 21, 2025 at 7:52 PM Jonathan Wakely <jwakely@redhat.com> wrote:
> >
> > On Thu, 20 Nov 2025 at 17:51, Yuao Ma <addr2line@gmail.com> wrote:
> > >
> > > Hi all,
> > >
> > > This patch implements P3044R2 by adding a subview function for string
> > > and string_view. The implementation delegates directly to substr.
> > > Tested on x86_64-linux.
> >
> > The new basic_string::subview member needs to be added to
> > include/bits/cow_string.h as well, or the new tests need to be
> > disabled for the old COW std::string ABI.
> >
>
> The nodiscard and Markdown symbols are fixed. I also added the

Thanks!

> cxx11_abi effective target to the tests, since we likely don't want to
> use the COW ABI with C++26.

You would be surprised, people still do use it!

If the feature is absent for the COW string then bits/version.def
needs to use cxx11abi = yes so that the new macro is not defined for
the COW ABI.



More information about the Libstdc++ mailing list