C++ Logo

std-proposals

Advanced search

Re: [std-proposals] Default arguments should participate in template argument deduction

From: Edward Catmur <ecatmur_at_[hidden]>
Date: Wed, 30 Mar 2022 02:34:33 +0100
On Tue, 29 Mar 2022 at 18:56, Marcin Jaczewski via Std-Proposals <
std-proposals_at_[hidden]> wrote:

> > It also isn't a solution if the callback needs to accept more than one
> set of arguments, or an argument type which isn't easily calculated within
> the signature.
>
> Would it be fixed by Proxy proposal?
> http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p0957r6.pdf
> Still we need to pay some for type erasure overhead but calling set is
> fully customizabe.
>

If I understand the Proxy proposal correctly, it would solve the multiple
signatures case but not the case where it's difficult or impossible to
calculate the callback argument type within the outer signature.

It's a bit difficult to describe, but it can happen in code that's not all
that complicated - consider passing to the callback a
ranges::transform_view where the transforming function is a lambda.

Received on 2022-03-30 01:34:45