public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "gcc-bugs at marehr dot dialup.fu-berlin.de" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug libstdc++/100139] New: std::views::{take, drop} don't type erase
Date: Sun, 18 Apr 2021 23:38:56 +0000	[thread overview]
Message-ID: <bug-100139-4@http.gcc.gnu.org/bugzilla/> (raw)

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

             reply	other threads:[~2021-04-18 23:38 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-18 23:38 gcc-bugs at marehr dot dialup.fu-berlin.de [this message]
2021-04-19  1:04 ` [Bug libstdc++/100139] " ppalka at gcc dot gnu.org
2021-08-19 10:39 ` redi at gcc dot gnu.org
2021-08-19 12:03 ` cvs-commit at gcc dot gnu.org
2021-08-19 13:59 ` cvs-commit at gcc dot gnu.org
2021-08-19 14:08 ` cvs-commit at gcc dot gnu.org

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-100139-4@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).