public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug libstdc++/104801] New: std::ranges::view_interface::empty is overconstrained
@ 2022-03-05 21:16 reconnoo at gmail dot com
2022-03-06 4:16 ` [Bug libstdc++/104801] " hewillk at gmail dot com
` (3 more replies)
0 siblings, 4 replies; 5+ messages in thread
From: reconnoo at gmail dot com @ 2022-03-05 21:16 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104801
Bug ID: 104801
Summary: std::ranges::view_interface::empty is overconstrained
Product: gcc
Version: 12.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: libstdc++
Assignee: unassigned at gcc dot gnu.org
Reporter: reconnoo at gmail dot com
Target Milestone: ---
I can't see why empty() needs a forward_iterator. It looks overconstrained and
input_iterator should suffice because it is equivalent to the begin/end
iterator comparison, yet, somehow this does not compile:
auto is = std::istringstream{"1 2 3"};
auto v = ranges::istream_view<int>(is);
{
auto is_empty = v.empty(); // error
}
{
auto [begin, end] = std::subrange(v);
auto is_empty = begin == end; // works
}
^ permalink raw reply [flat|nested] 5+ messages in thread
* [Bug libstdc++/104801] std::ranges::view_interface::empty is overconstrained
2022-03-05 21:16 [Bug libstdc++/104801] New: std::ranges::view_interface::empty is overconstrained reconnoo at gmail dot com
@ 2022-03-06 4:16 ` hewillk at gmail dot com
2022-03-06 12:32 ` reconnoo at gmail dot com
` (2 subsequent siblings)
3 siblings, 0 replies; 5+ messages in thread
From: hewillk at gmail dot com @ 2022-03-06 4:16 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104801
康桓瑋 <hewillk at gmail dot com> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |hewillk at gmail dot com
--- Comment #1 from 康桓瑋 <hewillk at gmail dot com> ---
Because istream_view is a single pass range, once you call its begin(), it will
change the internal state.
^ permalink raw reply [flat|nested] 5+ messages in thread
* [Bug libstdc++/104801] std::ranges::view_interface::empty is overconstrained
2022-03-05 21:16 [Bug libstdc++/104801] New: std::ranges::view_interface::empty is overconstrained reconnoo at gmail dot com
2022-03-06 4:16 ` [Bug libstdc++/104801] " hewillk at gmail dot com
@ 2022-03-06 12:32 ` reconnoo at gmail dot com
2022-03-06 12:37 ` hewillk at gmail dot com
2022-03-06 12:38 ` reconnoo at gmail dot com
3 siblings, 0 replies; 5+ messages in thread
From: reconnoo at gmail dot com @ 2022-03-06 12:32 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104801
Pawel P <reconnoo at gmail dot com> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |RESOLVED
Resolution|--- |FIXED
--- Comment #2 from Pawel P <reconnoo at gmail dot com> ---
I understand. Thank you for clarification
^ permalink raw reply [flat|nested] 5+ messages in thread
* [Bug libstdc++/104801] std::ranges::view_interface::empty is overconstrained
2022-03-05 21:16 [Bug libstdc++/104801] New: std::ranges::view_interface::empty is overconstrained reconnoo at gmail dot com
2022-03-06 4:16 ` [Bug libstdc++/104801] " hewillk at gmail dot com
2022-03-06 12:32 ` reconnoo at gmail dot com
@ 2022-03-06 12:37 ` hewillk at gmail dot com
2022-03-06 12:38 ` reconnoo at gmail dot com
3 siblings, 0 replies; 5+ messages in thread
From: hewillk at gmail dot com @ 2022-03-06 12:37 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104801
--- Comment #3 from 康桓瑋 <hewillk at gmail dot com> ---
(In reply to Pawel P from comment #2)
> I understand. Thank you for clarification
You should close with RESOLVED INVALID since there is nothing to fix.
^ permalink raw reply [flat|nested] 5+ messages in thread
* [Bug libstdc++/104801] std::ranges::view_interface::empty is overconstrained
2022-03-05 21:16 [Bug libstdc++/104801] New: std::ranges::view_interface::empty is overconstrained reconnoo at gmail dot com
` (2 preceding siblings ...)
2022-03-06 12:37 ` hewillk at gmail dot com
@ 2022-03-06 12:38 ` reconnoo at gmail dot com
3 siblings, 0 replies; 5+ messages in thread
From: reconnoo at gmail dot com @ 2022-03-06 12:38 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104801
Pawel P <reconnoo at gmail dot com> changed:
What |Removed |Added
----------------------------------------------------------------------------
Resolution|FIXED |INVALID
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2022-03-06 12:38 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-03-05 21:16 [Bug libstdc++/104801] New: std::ranges::view_interface::empty is overconstrained reconnoo at gmail dot com
2022-03-06 4:16 ` [Bug libstdc++/104801] " hewillk at gmail dot com
2022-03-06 12:32 ` reconnoo at gmail dot com
2022-03-06 12:37 ` hewillk at gmail dot com
2022-03-06 12:38 ` reconnoo at gmail dot com
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).