[Bug libstdc++/123211] Consider specializing ranges::distance for join_view

"cvs-commit at gcc dot gnu.org via Gcc-bugs" <[email protected]>
Newsgroups gmane.comp.gcc.bugs
Message-ID <[email protected]/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=123211

--- Comment #6 from GCC Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Patrick Palka <[email protected]>:

https://gcc.gnu.org/g:15505d012872ddb4c20916c41284e913727b4c80

commit r17-2859-g15505d012872ddb4c20916c41284e913727b4c80
Author: Patrick Palka <[email protected]>
Date:   Fri Jul 31 14:56:29 2026 -0400

    libstdc++: Optimize ranges::distance for segmented iterators [PR123211]

    For segmented iterators, ranges::distance is equivalent to the sum of
    ranges::distance of each of its segments.

            PR libstdc++/123211

    libstdc++-v3/ChangeLog:

            * include/bits/ranges_base.h (__distance_fn::operator()): For
            the non-sized-sentinel overload, recursively handle segmented
            iterators via __for_each_segment.

    Reviewed-by: Jonathan Wakely <[email protected]>
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.