public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
From: Patrick Palka <ppalka@gcc.gnu.org>
To: gcc-cvs@gcc.gnu.org, libstdc++-cvs@gcc.gnu.org
Subject: [gcc r13-2569] libstdc++: Fix return type of empty zip_/adjacent_transform [PR106803]
Date: Fri,  9 Sep 2022 19:05:08 +0000 (GMT)	[thread overview]
Message-ID: <20220909190508.6E6783856DC4@sourceware.org> (raw)

https://gcc.gnu.org/g:8298427f6b546cabb853edd45c009cd1967b9d38

commit r13-2569-g8298427f6b546cabb853edd45c009cd1967b9d38
Author: Patrick Palka <ppalka@redhat.com>
Date:   Fri Sep 9 14:59:14 2022 -0400

    libstdc++: Fix return type of empty zip_/adjacent_transform [PR106803]
    
            PR libstdc++/106803
    
    libstdc++-v3/ChangeLog:
    
            * include/std/ranges (views::_ZipTransform::operator()): Correct
            return type in the empty case.
            (views::_AdjacentTransform::operator()): Likewise.

Diff:
---
 libstdc++-v3/include/std/ranges | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/libstdc++-v3/include/std/ranges b/libstdc++-v3/include/std/ranges
index 37ad80ad3de..20eb4e82ac8 100644
--- a/libstdc++-v3/include/std/ranges
+++ b/libstdc++-v3/include/std/ranges
@@ -5071,7 +5071,7 @@ namespace views::__adaptor
 	operator() [[nodiscard]] (_Fp&& __f, _Ts&&... __ts) const
 	{
 	  if constexpr (sizeof...(_Ts) == 0)
-	    return views::empty<decay_t<invoke_result_t<_Fp>>>;
+	    return views::empty<decay_t<invoke_result_t<decay_t<_Fp>&>>>;
 	  else
 	    return zip_transform_view(std::forward<_Fp>(__f), std::forward<_Ts>(__ts)...);
 	}
@@ -5762,7 +5762,7 @@ namespace views::__adaptor
 	  operator() [[nodiscard]] (_Range&& __r, _Fp&& __f) const
 	  {
 	    if constexpr (_Nm == 0)
-	      return views::empty<tuple<>>;
+	      return zip_transform(std::forward<_Fp>(__f));
 	    else
 	      return adjacent_transform_view<all_t<_Range>, decay_t<_Fp>, _Nm>
 		(std::forward<_Range>(__r), std::forward<_Fp>(__f));

                 reply	other threads:[~2022-09-09 19:05 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20220909190508.6E6783856DC4@sourceware.org \
    --to=ppalka@gcc.gnu.org \
    --cc=gcc-cvs@gcc.gnu.org \
    --cc=libstdc++-cvs@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).