[PATCH 1/3, 11 backport] libstdc++: Implement P2325 changes to default-constructibility of views

Jonathan Wakely jwakely@redhat.com
Fri Feb 11 13:35:22 GMT 2022


On Thu, 10 Feb 2022 at 17:29, Patrick Palka via Libstdc++
<libstdc++@gcc.gnu.org> wrote:
>
> On Thu, 10 Feb 2022, Patrick Palka wrote:
>
> > Tested on x86_64-pc-linux-gnu, does this look OK for the 11 branch?
> > The backport to the 10 branch hasn't been started yet, I figured it'd
> > be good to first get the 11 backport right then base the 10 backport
> > on the 11 one.
> >
> > NB: This backport of r12-1606 to the 11 branch deliberately omits parts
> > of P2325R3 so as to maximize backward compatibility with pre-P2325R3 code.
> > In particular, we don't remove the default ctors for back_insert_iterator,
> > front_insert_iterator, ostream_iterator, ref_view and basic_istream_view.
[...]
> > @@ -670,8 +710,6 @@ namespace views
> >       using difference_type = ptrdiff_t;
> >       using value_type = _Val;
> >
> > -     _Iterator() = default;
>
> Drat, this default ctor (for basic_istream_view::iterator) should not
> be removed in the backport.  Here's v2 which fixes this mistake (and
> thus the static_assert on line 77 of p2325.cc now fails as expected):


Good catch. This one's OK for gcc-11, and if it applies cleanly to
gcc-10 as-is, there too.



More information about the Gcc-patches mailing list