public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug libstdc++/95322] New: std::list | take | transform, expression does not work cbegin() == end()
@ 2020-05-25 18:16 gcc-bugs at marehr dot dialup.fu-berlin.de
  2020-05-26 13:13 ` [Bug libstdc++/95322] " redi at gcc dot gnu.org
                   ` (18 more replies)
  0 siblings, 19 replies; 20+ messages in thread
From: gcc-bugs at marehr dot dialup.fu-berlin.de @ 2020-05-25 18:16 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 95322
           Summary: std::list | take | transform, expression does not work
                    cbegin() == end()
           Product: gcc
           Version: 10.1.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: libstdc++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: gcc-bugs at marehr dot dialup.fu-berlin.de
  Target Milestone: ---

Hello gcc-team,

I'm not sure if this is intended behaviour, or if this is a defect in the
standard, or something that you should never write in a generic context.

ASFAIK you can use that expression on any container and on any view, but not on
some(?!) combinations of views? This is a bit unexpected.

```c++
#include <concepts>
#include <list>
#include <ranges>

int main()
{

    std::list v{0,1 ,2, 3, 4, 5, 5, 6}; // works if std::vector

    auto view1 = v | std::views::take(5);
    auto view2 = v | std::views::transform([] (int i) { return i + 3;});
    auto view3 = view1 | std::views::transform([] (int i) { return i + 3;});

    std::ranges::cbegin(view1) == std::ranges::end(view1); // works
    std::ranges::cbegin(view2) == std::ranges::end(view2); // works
    std::ranges::cbegin(view3) == std::ranges::end(view3); // does not work
    return 0;
}
```

https://godbolt.org/z/4Nzr69

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

end of thread, other threads:[~2020-12-01 16:20 UTC | newest]

Thread overview: 20+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-25 18:16 [Bug libstdc++/95322] New: std::list | take | transform, expression does not work cbegin() == end() gcc-bugs at marehr dot dialup.fu-berlin.de
2020-05-26 13:13 ` [Bug libstdc++/95322] " redi at gcc dot gnu.org
2020-05-26 13:18 ` redi at gcc dot gnu.org
2020-05-26 13:21 ` redi at gcc dot gnu.org
2020-05-26 13:54 ` ppalka at gcc dot gnu.org
2020-05-26 20:45 ` cvs-commit at gcc dot gnu.org
2020-05-27 20:00 ` redi at gcc dot gnu.org
2020-05-27 20:04 ` daniel.kruegler at googlemail dot com
2020-05-27 20:29 ` redi at gcc dot gnu.org
2020-05-27 21:08 ` cvs-commit at gcc dot gnu.org
2020-05-27 21:11 ` redi at gcc dot gnu.org
2020-05-28  1:48 ` cvs-commit at gcc dot gnu.org
2020-05-28 18:51 ` daniel.kruegler at googlemail dot com
2020-07-09 12:59 ` cvs-commit at gcc dot gnu.org
2020-07-09 14:51 ` redi at gcc dot gnu.org
2020-07-09 17:54 ` gcc-bugs at marehr dot dialup.fu-berlin.de
2020-08-27  1:53 ` cvs-commit at gcc dot gnu.org
2020-10-12 17:48 ` cvs-commit at gcc dot gnu.org
2020-10-21  1:57 ` cvs-commit at gcc dot gnu.org
2020-12-01 16:20 ` cvs-commit 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).