C++ Logo

std-proposals

Advanced search

Re: [std-proposals] Labelled parameters

From: Jens Maurer <jens.maurer_at_[hidden]>
Date: Tue, 6 Jan 2026 15:15:03 +0100
On 1/6/26 09:27, David Brown via Std-Proposals wrote:
> On 06/01/2026 00:32, Jonathan Wakely via Std-Proposals wrote:
>
>> On Mon, 5 Jan 2026, 23:09 Jason McKesson via Std-Proposals,
>> <std-proposals_at_[hidden] <mailto:std-proposals_at_[hidden]>>
>> wrote:
>>
>
>>
>> Is it even legal for a C++ standard library implementation to use the
>> standard-defined parameter names?
>>
>>
>> It depends on the name. Some parameter names happen to use names that
>> are already reserved by the standard library (e.g. "first" is reserved
>> because of std::pair::first so any parameter called first can be named
>> exactly that in an implementation).

> Am I correct in thinking that a C++ standard library /could/ use the
> parameter names as documented in the standard, if modules were used
> rather than headers? If so, then that might give a path towards being
> able to use named parameters with the standard library functions.

Well, once we specify the parameter names and say that the "named parameters"
feature works with the standard library, that gives implicit protection against
user macros per [reserved.names.general] (might need a slight amendment).

(What does "global names" mean there? Do they not have external linkage?)

In general, we feel at liberty to add new library facilities (and thus names),
even though it theoretically breaks some programs. But that's generally
accepted, because users are supposed to use uppercase for macros, not
lower_snake_case as the standard library does for its names.

Jens

Received on 2026-01-06 14:15:10