C++ Logo

STD-PROPOSALS

Advanced search

Subject: Re: [std-proposals] Make class template parameters available externally
From: Dmitry (dimanne_at_[hidden])
Date: 2019-10-31 03:17:06


On Thu, 31 Oct 2019 at 07:57, <language.lawyer_at_[hidden]> wrote:

> I think your vector example is a bit unfortunate.
> STDlib implementers would still have to use reserved identifiers as
> template parameter names.
>

Do you know why/where from those rules have orginitated? What is the
rationale behind them?

If the rules (to have weird template parameter names in STL) come into
existence just because there was no possibility to have just one name
usable inside a class and outside, then this proposal fixes just that. And
with this proposal they are free to just one name.

After all, in 99% time the STL implementers are not using
obfuscated/distorted names for such things as "vector", "unordered_map" and
so on...

While theoretically, they could (and I think there are such cases):

namespace std {

   namespace priv {

      class __vector<...> {};
   }

using vector = priv::__vector<...>;

}

It means that nothing prevents them from using "normal" names for template
parameters, right?



STD-PROPOSALS list run by std-proposals-owner@lists.isocpp.org

Standard Proposals Archives on Google Groups