Subject: Re: [std-proposals] Make class template parameters available externally
From: Ville Voutilainen (ville.voutilainen_at_[hidden])
Date: 2019-10-30 17:04:16
On Wed, 30 Oct 2019 at 23:52, Dmitry <dimanne_at_[hidden]> wrote:
>> So, basically,
>> 1) when looking for a nested name, do normal lookup
>> 2) if that didn't find anything, look into the template parameters
>> If I then _don't_ want to expose such a template parameter name, what do I do?
> Looks like you have not read my proposal :)
> Here is an excerpt from it:
> What if I did not want to redefine them?
> First of all, it turns out that they are a crucial part of an interface and often or always are of interest to end-users. A quick survey of STL shows that all containers declare all their template parameters and make them available to users.
My quick survey shows that none of them do, not with those names. And
a library implementation of what is specified to
template<class T, size_t N>
doesn't mention "T" or "N" anywhere in it.
> Secondly, if there will be found a compelling enough argument for having the possibility to disable the feature, an approach similar to "= delete" can be adopted.
> (or you can declare them in private section, as an alternative)
Declaring private names is not the same thing as not declaring names.
This seems to be starting a journey on the road where the benefit
is not worth the cost.
STD-PROPOSALS list run by email@example.com
Standard Proposals Archives on Google Groups