public inbox for gcc-bugs@sourceware.org help / color / mirror / Atom feed
From: "cvs-commit at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org> To: gcc-bugs@gcc.gnu.org Subject: [Bug libstdc++/107572] cartesian_product_view invokes the begin of input_range twice Date: Thu, 09 Mar 2023 18:25:53 +0000 [thread overview] Message-ID: <bug-107572-4-PxbpTKSkMq@http.gcc.gnu.org/bugzilla/> (raw) In-Reply-To: <bug-107572-4@http.gcc.gnu.org/bugzilla/> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107572 --- Comment #1 from CVS Commits <cvs-commit at gcc dot gnu.org> --- The master branch has been updated by Patrick Palka <ppalka@gcc.gnu.org>: https://gcc.gnu.org/g:3df9760d56662bdf38dd45f7398f003bbd64fdfe commit r13-6558-g3df9760d56662bdf38dd45f7398f003bbd64fdfe Author: Patrick Palka <ppalka@redhat.com> Date: Thu Mar 9 13:25:44 2023 -0500 libstdc++: extraneous begin in cartesian_product_view::end [PR107572] ranges::begin() isn't guaranteed to be equality-preserving for non-forward ranges, so in cartesian_product_view::end we need to avoid needlessly calling begin() on the first range (which could be non-forward) in the case where __empty_tail is false as per its specification. Since we're already using a variadic lambda to compute __empty_tail, we might as well use that same lambda to build up the tuple of iterators instead of building it separately via e.g. std::apply or __tuple_transform. PR libstdc++/107572 libstdc++-v3/ChangeLog: * include/std/ranges (cartesian_product_view::end): When building the tuple of iterators, avoid calling ranges::begin on the first range if __empty_tail is false. * testsuite/std/ranges/cartesian_product/1.cc (test07): New test.
next prev parent reply other threads:[~2023-03-09 18:25 UTC|newest] Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top 2022-11-08 15:25 [Bug libstdc++/107572] New: " hewillk at gmail dot com 2022-11-08 15:35 ` [Bug libstdc++/107572] " redi at gcc dot gnu.org 2023-03-07 21:07 ` ppalka at gcc dot gnu.org 2023-03-09 18:25 ` cvs-commit at gcc dot gnu.org [this message] 2023-03-09 18:27 ` ppalka 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-107572-4-PxbpTKSkMq@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: linkBe 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).