N3867: Specializations and namespaces (Rev. 2) -- Mike Spertus

A new WG21 paper is available. A copy is linked below, and the paper will also appear in the next normal WG21 mailing. If you are not a committee member, please use the comments section below or the std-proposals forum for public discussion.

Document number: N3867

Date: 2014-01-19

Specializations and namespaces (Rev. 2)

by Mike Spertus

Excerpt:

We propose to allow specializing templates from within a different namespace. The motivation is that when we declare a new class, it is natural to want to provide associated template specializations. For example, it is really painful that whenever I declare a class, I need to class all open namespaces and enter namespace std just to specialize std::hash as shown below ...

The technical point is that the primary template identifies the template's namespace, so we don't need to use the namespace enclosing the specialization's definition to identify it's namespace.

Add a Comment

Comments are closed.

Comments (0)

There are currently no comments on this entry.