C++ Logo

std-proposals

Advanced search

Re: [std-proposals] Direct-list-initialization syntax for default function arguments

From: Simon Schröder <dr.simon.schroeder_at_[hidden]>
Date: Wed, 17 Jun 2026 08:31:00 +0200
> On Jun 16, 2026, at 2:20 PM, Sebastian Wittmeier via Std-Proposals <std-proposals_at_[hidden]> wrote:
>
> In this case
>
>
>
> X g(auto = X{5});
>
>
> deducting the rhs type for the unnamed parameter
>

I also immediately thought of this. However, auto in a function makes it a templated function. So, this rather reads as a templated function with the default type X and the default value 5.

Received on 2026-06-17 06:31:15