C++ Logo

std-proposals

Advanced search

Re: [std-proposals] Named auto

From: Lénárd Szolnoki <cpp_at_[hidden]>
Date: Thu, 29 Sep 2022 20:57:31 +0100
Hi,

On 29 September 2022 20:25:06 BST, Edward Catmur <ecatmur_at_[hidden]> wrote:
>On Thu, 29 Sept 2022 at 18:15, Lénárd Szolnoki via Std-Proposals <
>std-proposals_at_[hidden]> wrote:
>
>> I think this could be addressed by two distinct proposals.
>>
>> 1. allow placeholders to appear in any deduced context (std::vector<auto>)
>> 2. allow a placeholder to introduce a name (auto<class T>, auto<int i>
>> might appear as a deduced nttp)
>>
>> Then you can have your vector<auto<class T>> to deduce the value type and
>> introduce the name T for that.
>>
>
>std::vector<auto> is problematic, because elsewhere auto means a value of
>unconstrained type (e.g. in template<auto>).

I disagree. auto is a placeholder for the type of the non-type parameter. If you don't omit the name, then that name refers to the value.

Cheers,
Lénárd

Received on 2022-09-29 19:57:35