C++ Logo

std-proposals

Advanced search

Re: Make class template parameters available externally

From: Andrey Semashev <andrey.semashev_at_[hidden]>
Date: Thu, 31 Oct 2019 12:17:06 +0300
On 2019-10-31 03:54, Miguel Ojeda via Std-Proposals wrote:
> On Thu, Oct 31, 2019 at 1:09 AM Sebastian Büttner via Std-Proposals
> <std-proposals_at_[hidden]> wrote:
>>
>> I don't think that the meaning is consistent here. Declaring something private isn't the same as not declaring it at all.
>>
>> Also: how is declaring a template parameter private/public affecting inheritance? Is the behavior consistent with class member access control? Is a private declared template parameter of class B not accessible in a derived class D? Can I declare a template parameter protected then?
>>
>> template<public class first_param, private class second_param>
>
> No need for double keyword:
>
> template <public A, protected B, private C, class D>
>
> where A/B/C are declared and D is not declared at all, as usual.
>
> For NTTPs, not sure if the grammar is ambiguous or not, though; but it
> would look clean too, e.g.:
>
> template <public size_t max_size>
>
> If there is ambiguity, there is always the classic way as fallback.

I don't like the idea of adding a shorthand with an ambiguity.

Received on 2019-10-31 04:19:26