C++ Logo

std-proposals

Advanced search

Re: [std-proposals] std::constant_size_function

From: Lénárd Szolnoki <cpp_at_[hidden]>
Date: Mon, 17 Jun 2024 15:02:07 +0100
On 16/06/2024 01:23, Frederick Virchanza Gotham via Std-Proposals wrote:
> I reply in series to Lénárd and Bjorn below.
>
>
> On Fri, Jun 14, 2024 at 12:14 PM Lénárd Szolnoki wrote;
>>
>> You can avoid type-erasing the lambda that you are
>> capturing in the std::function and store it directly.
>
>
> Not sure what you mean here. Could you please provide a code snippet
> or a godbolt?

https://godbolt.org/z/5GsY86f6Y

>
>
> On Fri, Jun 14, 2024 at 12:26 PM Bjorn Reese wrote:
>>
>> std::function is about type-erasure, which std::elide does not need.
>> The proper tool for the job is std::bind_front.
>
>
> Could you please confirm if the following is what you had in mind?
>
> https://godbolt.org/z/5hnfvzEYv

Received on 2024-06-17 14:02:10