public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/94674] New: std::ranges::basic_istream_view::iterator is missing std::iterator_traits entries
@ 2020-04-20 17:54 gcc-bugs at marehr dot dialup.fu-berlin.de
  2020-04-20 19:33 ` [Bug libstdc++/94674] " redi at gcc dot gnu.org
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: gcc-bugs at marehr dot dialup.fu-berlin.de @ 2020-04-20 17:54 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 94674
           Summary: std::ranges::basic_istream_view::iterator is missing
                    std::iterator_traits entries
           Product: gcc
           Version: 10.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: gcc-bugs at marehr dot dialup.fu-berlin.de
  Target Milestone: ---

Hi gcc-team,

I'm not sure if I should have named the issue `std::iterator_traits is missing
default values for an iterator` (https://eel.is/c++draft/iterator.traits#3.2).

Maybe I misunderstood this, but I thought that I can query every iterator for
it's traits.

The following code does not work:

```c++
#include <ranges>
#include <istream>
#include <string_view>

int main()
{
    // std::string_view view; // does work
    auto && view = std::ranges::basic_istream_view<int, char,
std::char_traits<char>>{}; // does not work
    // auto && view = std::ranges::take_view<std::string_view>{}; // does work

    using iterator_t = std::ranges::iterator_t<decltype(view)>;
    using iter_value1_t = std::iter_value_t<iterator_t>;
    using iter_value2_t = typename
std::iterator_traits<iterator_t>::value_type;

    static_assert(std::same_as<iter_value1_t, iter_value2_t>);
    return 0;
}
```

with `g++-10 -std=c++2a`


https://godbolt.org/z/QAfdml

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

end of thread, other threads:[~2020-04-20 21:46 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-04-20 17:54 [Bug c++/94674] New: std::ranges::basic_istream_view::iterator is missing std::iterator_traits entries gcc-bugs at marehr dot dialup.fu-berlin.de
2020-04-20 19:33 ` [Bug libstdc++/94674] " redi at gcc dot gnu.org
2020-04-20 19:39 ` redi at gcc dot gnu.org
2020-04-20 19:59 ` gcc-bugs at marehr dot dialup.fu-berlin.de
2020-04-20 21:43 ` redi at gcc dot gnu.org
2020-04-20 21:46 ` 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).