This page is a snapshot from the LWG issues list, see the Library Active Issues List for more information and the meaning of C++23 status.
views::zip_transform
still requires F
to be copy_constructible
when empty packSection: 25.7.26.1 [range.zip.transform.overview] Status: C++23 Submitter: Hewill Kang Opened: 2022-09-12 Last modified: 2024-01-29
Priority: Not Prioritized
View all issues with C++23 status.
Discussion:
After P2494R2, range adaptors only require callable to be
move_constructible
, however, for views::zip_transform
,
when empty pack, it still requires callable to be copy_constructible
.
We should relax this requirement, too.
[2022-09-23; Reflector poll]
Set status to Tentatively Ready after seven votes in favour during reflector poll.
[2022-11-12 Approved at November 2022 meeting in Kona. Status changed: Voting → WP.]
Proposed resolution:
This wording is relative to N4910.
Modify 25.7.26.1 [range.zip.transform.overview] as indicated:
-2- The name
views::zip_transform
denotes a customization point object (16.3.3.3.5 [customization.point.object]). LetF
be a subexpression, and letEs...
be a pack of subexpressions.
(2.1) — If
Es
is an empty pack, letFD
bedecay_t<decltype((F))>
.
(2.1.1) — If
move_constructible
iscopy_constructible<FD> && regular_invocable<FD&>false
, or ifdecay_t<invoke_result_t<FD&>>
is not an object type,views::zip_transform(F, Es...)
is ill-formed.(2.1.2) — Otherwise, the expression
views::zip_transform(F, Es...)
is expression-equivalent to((void)F, auto(views::empty<decay_t<invoke_result_t<FD&>>>))(2.2) — Otherwise, the expression
views::zip_transform(F, Es...)
is expression-equivalent tozip_transform_view(F, Es...)
.