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.
This commit is contained in:
parent
e469506b7f
commit
8298427f6b
1 changed files with 2 additions and 2 deletions
|
@ -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));
|
||||
|
|
Loading…
Add table
Reference in a new issue