public inbox for libstdc++-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc r13-2569] libstdc++: Fix return type of empty zip_/adjacent_transform [PR106803]
@ 2022-09-09 19:05 Patrick Palka
  0 siblings, 0 replies; only message in thread
From: Patrick Palka @ 2022-09-09 19:05 UTC (permalink / raw)
  To: gcc-cvs, libstdc++-cvs

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));

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2022-09-09 19:05 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-09-09 19:05 [gcc r13-2569] libstdc++: Fix return type of empty zip_/adjacent_transform [PR106803] Patrick Palka

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