Title
Local types can now instantiate templates
Status
c++11
Section
[namespace.std]
Submitter
LWG

Created on 2009-06-28.00:00:00 last changed 154 months ago

Messages

Date: 2010-10-21.18:28:33

Proposed resolution:

[namespace.std]

Strike "of external linkage" in p1 and p2:

-1- The behavior of a C++ program is undefined if it adds declarations or definitions to namespace std or to a namespace within namespace std unless otherwise specified. A program may add a concept map for any standard library concept or a template specialization for any standard library template to namespace std only if the declaration depends on a user-defined type of external linkage and the specialization meets the standard library requirements for the original template and is not explicitly prohibited.179

-2- The behavior of a C++ program is undefined if it declares

  • an explicit specialization of any member function of a standard library class template, or
  • an explicit specialization of any member function template of a standard library class or class template, or
  • an explicit or partial specialization of any member class template of a standard library class or class template.

A program may explicitly instantiate a template defined in the standard library only if the declaration depends on the name of a user-defined type of external linkage and the instantiation meets the standard library requirements for the original template.

Date: 2010-10-21.18:28:33

[ 2009-10 Santa Cruz: ]

Moved to Ready.

Date: 2009-07-28.00:00:00

[ 2009-07-28 Alisdair provided wording. ]

Date: 2009-06-28.00:00:00

Addresses UK 175

Description

Local types can now be used to instantiate templates, but don't have external linkage.

Suggestion

Remove the reference to external linkage.

Notes

We accept the proposed solution. Martin will draft an issue.

History
Date User Action Args
2011-08-23 20:07:26adminsetstatus: wp -> c++11
2010-10-21 18:28:33adminsetmessages: + msg948
2010-10-21 18:28:33adminsetmessages: + msg947
2010-10-21 18:28:33adminsetmessages: + msg946
2009-06-28 00:00:00admincreate