C++ Logo

std-proposals

Advanced search

Re: [std-proposals] Member apply

From: Kang Hewill <hewillk_at_[hidden]>
Date: Tue, 4 Jul 2023 10:53:48 +0800
>
> R0 of this paper already proposed it, and LEWG didn't like it. First
> telecon it was discussed at (
> https://github.com/cplusplus/papers/issues/1303#issuecomment-1301074000)
> there was a poll to remove the apply part, 2-6-6-1-0.


This is very good information, I didn't expect this issue to have been
discussed by the committee.
Thanks also for the valuable insights from others.

Hewill

Barry Revzin <barry.revzin_at_[hidden]> 於 2023年7月4日 週二 上午3:15寫道:

>
>
> On Mon, Jul 3, 2023, 10:15 AM Kang Hewill via Std-Proposals <
> std-proposals_at_[hidden]> wrote:
>
>> Dear experts,
>>
>> With the introduction of deducing this in C++23, variants in C++26 will
>> have a member visit P2637R3 <https://wg21.link/P2637R3>, which is a
>> great feature.
>> I wonder, is it good to also add member apply to tuple-like objects? For
>> example:
>>
>> auto sum = std::tuple{0, 'a'}.apply(std::plus{});
>> auto dist = ranges::subrange{...}.apply([](auto i, auto s) { return s
>> - i; });
>>
>> Is this consistency superfluous, or does it have some value? One benefit
>> I can think of is that this enables us to write the form of
>>
>> tuple.apply(...).apply(...).apply(...).apply(...)
>>
>> which may be an enhancement. What do you think?
>>
>> Hewill
>>
>
> R0 of this paper already proposed it, and LEWG didn't like it. First
> telecon it was discussed at (
> https://github.com/cplusplus/papers/issues/1303#issuecomment-1301074000)
> there was a poll to remove the apply part, 2-6-6-1-0.
>
> Barry
>
>>

Received on 2023-07-04 02:54:00