C++ Logo

std-proposals

Advanced search

Make class template parameters available externally

From: Dmitry <dimanne_at_[hidden]>
Date: Wed, 30 Oct 2019 20:48:59 +0000
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.

-- 
Dmitry
*Sent from gmail*

Received on 2019-10-30 15:51:44