public inbox for
 help / color / mirror / Atom feed
From: Patrick Palka <>
Cc:, Patrick Palka <>
Subject: [PATCH 3/3] libstdc++: Fix return type of empty zip/adjacent_transform [PR106803]
Date: Fri,  9 Sep 2022 13:24:46 -0400	[thread overview]
Message-ID: <> (raw)
In-Reply-To: <>

Tested on x86_64-pc-linux-gnu, does this series look OK for trunk?

	PR libstdc++/106803


	* include/std/ranges (views::_ZipTransform::operator()): Fix
	return type in the empty case.
	(views::_AdjacentTransform::operator()): Likewise.
 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>&>>>;
 	    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));
 	      return adjacent_transform_view<all_t<_Range>, decay_t<_Fp>, _Nm>
 		(std::forward<_Range>(__r), std::forward<_Fp>(__f));

      parent reply	other threads:[~2022-09-09 17:24 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-09 17:24 [PATCH 1/3] libstdc++: Fix zip_view's operator- for integer-class difference type [PR106766] Patrick Palka
2022-09-09 17:24 ` [PATCH 2/3] libstdc++: Fix typo in adjacent_view::_Iterator [PR106798] Patrick Palka
2022-09-09 17:24 ` Patrick Palka [this message]

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:

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

  git send-email \ \ \ \ \

* 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).