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

            Bug ID: 100139
           Summary: std::views::{take, drop} don't type erase
           Product: gcc
           Version: 11.0
            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,

the following code:

```cpp
#include <concepts>
#include <ranges>
#include <span>
#include <string_view>

static_assert(std::same_as<std::span<int>,
              decltype(std::views::take(std::span<int>{}, 2))>);

static_assert(std::same_as<std::string_view,
              decltype(std::views::take(std::string_view{}, 2))>);
```

does not compile (yet).

https://godbolt.org/z/6Mq7x8zaj

AFAIK this should be
http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p1739r0.md that was
merged by https://github.com/cplusplus/draft/pull/3777.

There was a rather amusing error report at stackoverflow [1].

I tried to find that proposal in [2] but couldn't and wanted to ask if I looked
at the wrong place. If you have time to implement this, that would be awesome!

Thank you!

[1]
https://stackoverflow.com/questions/61867635/recursive-application-of-c20-range-adaptor-causes-a-compile-time-infinite-loop
[2] https://gcc.gnu.org/onlinedocs/libstdc++/manual/status.html#status.iso.2020
  • [Bug libstdc++/100... gcc-bugs at marehr dot dialup.fu-berlin.de via Gcc-bugs

Reply via email to