public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug libstdc++/97512] New: Move std::ranges::subrange structured bindings stuff from <ranges> to <ranges_util.h>
@ 2020-10-21  9:31 hewillk at gmail dot com
  2020-10-21 13:20 ` [Bug libstdc++/97512] " redi at gcc dot gnu.org
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: hewillk at gmail dot com @ 2020-10-21  9:31 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 97512
           Summary: Move std::ranges::subrange structured bindings stuff
                    from <ranges> to <ranges_util.h>
           Product: gcc
           Version: 11.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: libstdc++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: hewillk at gmail dot com
  Target Milestone: ---

In commit 160061a: libstdc++: Introduce new headers for C++20 ranges
components, structured bindings stuff of std::ranges::subrange is move into
<ranges> header itself, this will make following code failed in gcc-trunk
(https://godbolt.org/z/az5bfc):

#include <vector>
#include <algorithm>

int main() {
  std::vector v{1, 1, 2};
  auto [first, last] = std::ranges::unique(v);
}


error: cannot decompose inaccessible member 'std::ranges::subrange

Put structured bindings stuff together with subrange's definition should be
convenient for users, since std::ranges::remove/unique return a subrange, for a
user like me usually want to structurally bind it without extra including
<ranges>, or it would make sense to have these tuple-related specializations
close to the get functions, which are already in the <bits/ranges_util.h>
header.

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2020-10-21 14:13 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-10-21  9:31 [Bug libstdc++/97512] New: Move std::ranges::subrange structured bindings stuff from <ranges> to <ranges_util.h> hewillk at gmail dot com
2020-10-21 13:20 ` [Bug libstdc++/97512] " redi at gcc dot gnu.org
2020-10-21 14:13 ` cvs-commit at gcc dot gnu.org
2020-10-21 14:13 ` redi at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).