From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 7A9C03892020; Mon, 25 May 2020 18:16:15 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 7A9C03892020 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1590430575; bh=0GquEUcrIrBx3Tps+OykTU3Jc4ONmUBfoQ2jEGFWRe4=; h=From:To:Subject:Date:From; b=kCQKXndkV8UZwcZ8+zV4DQVEqkKYATACQQVvZwxV+fJzkz1Dy31iuJQSQUNLAniX7 3sgxVJFWiOPpS5QYVeWhHe5YasBiA1OtfW3TQYhNHebI/KnP86QXkG2iuHklQMB8/U qA94UOOr/qGLjovojR2SJxjSeUWpWMwmFQA0+cpo= From: "gcc-bugs at marehr dot dialup.fu-berlin.de" To: gcc-bugs@gcc.gnu.org Subject: [Bug libstdc++/95322] New: std::list | take | transform, expression does not work cbegin() == end() Date: Mon, 25 May 2020 18:16:15 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: libstdc++ X-Bugzilla-Version: 10.1.1 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: gcc-bugs at marehr dot dialup.fu-berlin.de X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter target_milestone Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: gcc-bugs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-bugs mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 May 2020 18:16:15 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D95322 Bug ID: 95322 Summary: std::list | take | transform, expression does not work cbegin() =3D=3D 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 no= t on some(?!) combinations of views? This is a bit unexpected. ```c++ #include #include #include int main() { std::list v{0,1 ,2, 3, 4, 5, 5, 6}; // works if std::vector auto view1 =3D v | std::views::take(5); auto view2 =3D v | std::views::transform([] (int i) { return i + 3;}); auto view3 =3D view1 | std::views::transform([] (int i) { return i + 3;= }); std::ranges::cbegin(view1) =3D=3D std::ranges::end(view1); // works std::ranges::cbegin(view2) =3D=3D std::ranges::end(view2); // works std::ranges::cbegin(view3) =3D=3D std::ranges::end(view3); // does not = work return 0; } ``` https://godbolt.org/z/4Nzr69=