C++ Logo

std-proposals

Advanced search

Re: Make class template parameters available externally

From: language.lawyer_at <language.lawyer_at_[hidden]>
Date: Thu, 31 Oct 2019 10:57:40 +0300
I think your vector example is a bit unfortunate.
STDlib implementers would still have to use reserved identifiers as template parameter names.

On 30/10/2019 23:48, Dmitry via Std-Proposals wrote:
> Hi,
> Here is a link
> <https://docs.google.com/document/d/1dx9zuklyI1l4wU2buGaDuZGik1nAdd1YAJZ4mjwS9FU/edit?usp=sharing>
> to an initial draft of my proposal about making class template parameters
> visible outside the scope of a class by default (without manual and
> explicit declaration them inside the class via using/typedef).
> Quick example:
>
> Before
>
> After
>
> template <class _Tp,
>
> class _Allocator>
>
> struct vector {
>
> typedef _Tp value_type;
>
> typedef _Allocator allocator_type;
>
> };
>
> vector<int>::value_type a = 0;
>
> template <class value_type,
>
> class allocator_type>
>
> struct vector {
>
> };
>
> vector<int>::value_type a = 0;
>
>
> Your feedback is appreciated.
>
>

Received on 2019-10-31 03:00:00