C++ Logo

std-proposals

Advanced search

Re: Make class template parameters available externally

From: Dmitry <dimanne_at_[hidden]>
Date: Thu, 31 Oct 2019 12:15:53 +0000
>
>
> Decomposing the type to know the template parameters is not the same as
> making these parameters part of the class' public interface.


 Right, not exactly the same.

There are
> cases when template parameters are used for auxiliary purposes, e.g. for
> SFINAE or tagging and specialization. These parameters should not be
> exposed.
>

It looks like this statement is the most important thing. And I am
struggling to understand why it is so. Can you please elaborate on this
more? Why do you think it is a bad idea? (I hope you read my proposal and
know that if there is already a user-defined type with the same name, they
won't be declared).



> I'm strongly opposed to making the proposed behavior the default. IMO,
> if implemented, it must be opt-in.
>
> Another thing to consider: unnamed template parameters.


Good point, but the answer naturally follows if you imagine what you can do
with this unnamed parameters inside class - you can't declare
using/typedef, ditto here, the answer to your question - there will be no
implicitly generated typedefs.

Received on 2019-10-31 07:18:22