C++ Logo

std-proposals

Advanced search

Re: Video Intro to WG21/D2288 C++ Designated Arguments

From: Jason McKesson <jmckesson_at_[hidden]>
Date: Mon, 22 Nov 2021 22:33:51 -0500
On Mon, Nov 22, 2021 at 2:22 PM Hani Deek via Std-Proposals
<std-proposals_at_[hidden]> wrote:
>
> I have not studied this issue carefully, but I think that one simple way to implement your proposal without introducing new things into the language is to allow the following syntax

Your suggestion misses one of the most important parts of the
proposal: handling variadic templates and forwarding. Specifically,
the ability to forward designators through a function. Your
alternative can't do that.

Indeed, the only way to call such a function through forwarding is to
explicitly construct a parameter of the proper type, which requires
being able to *name* the type, which you can't do if you declared the
parameter in the function declaration.

So adopting this syntax basically makes forwarding impossible.

Received on 2021-11-22 21:34:05