[PATCH] libstdc++: Fix iterator caching inside range adaptors [PR100479]

Jonathan Wakely jwakely@redhat.com
Mon May 24 18:59:50 GMT 2021


On 18/05/21 00:53 -0400, Patrick Palka via Libstdc++ wrote:
>On Mon, 17 May 2021, Tim Song wrote:
>
>> On Mon, May 17, 2021 at 2:59 PM Patrick Palka <ppalka@redhat.com> wrote:
>> >
>> > +       constexpr _CachedPosition&
>> > +       operator=(_CachedPosition&& __other) noexcept
>> > +       {
>> > +         if (std::__addressof(__other) != this)
>>
>> I don't think we need this check - self-move-assigning the underlying
>> view isn't required to be a no-op, so we should still invalidate.
>
>Sounds good, so like so:

Looks good to me (but then so did the previous one ;-)

Please push, as this is an improvement on what's on trunk now. If Tim
spots any more problems they can be fixed later.


Thanks both of you.



More information about the Libstdc++ mailing list