Title
Partial specialization and nullptr
Status
drafting
Section
_N4868_.13.7.6 [temp.class.spec]
Submitter
Faisal Vali

Created on 2015-05-18.00:00:00 last changed 72 months ago

Messages

Date: 2021-02-24.00:00:00

An example like the following would seem to be plausible:

  template<class T, T*> struct X { };
  // We want to partially specialize for all nullptrs...
  template<class T> struct X<T, nullptr> { ... }; // NOT OK

This is disallowed by the rule in bullet 8.2 of _N4868_.13.7.6 [temp.class.spec]:

  • The type of a template parameter corresponding to a specialized non-type argument shall not be dependent on a parameter of the specialization.

(See also issues 1315, 1647, and 2033.)

History
Date User Action Args
2015-05-18 00:00:00admincreate