[Bug libstdc++/97512] Move std::ranges::subrange structured bindings stuff from <ranges> to <ranges_util.h>

cvs-commit at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Wed Oct 21 14:13:05 GMT 2020


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97512

--- Comment #2 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Jonathan Wakely <redi@gcc.gnu.org>:

https://gcc.gnu.org/g:a186ab670e97c4c3883d96506655c4621e7c5515

commit r11-4188-ga186ab670e97c4c3883d96506655c4621e7c5515
Author: Jonathan Wakely <jwakely@redhat.com>
Date:   Wed Oct 21 14:40:54 2020 +0100

    libstdc++: Make structured bindings always work for subranges [PR 97512]

    The definition of ranges::subrange was moved to the new
    <bits/ranges_util.h> header so that it could be used in <algorithm>
    without including the whole of <ranges>. However, the tuple-like support
    that enables subrange to be used with structured bindings was left in
    <ranges>. This is arguably conforming (to use a subrange you should
    include <ranges>) but it's inconvenient and probably confusing.

    This change makes the tuple-like support available whenever subrange
    itself is available.

    libstdc++-v3/ChangeLog:

            PR libstdc++/97512
            * include/bits/ranges_util.h (tuple_size<subrange>)
            (tuple_element<I, cv subrange>): Move here from ...
            * include/std/ranges: ... here.
            * testsuite/std/ranges/subrange/97512.cc: New test.


More information about the Gcc-bugs mailing list