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

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

Messages

Date: 2022-06-11.20:21:09

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 9.2 of 13.7.6.1 [temp.spec.partial.general]:

  • 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