Created on 2008-11-02.00:00:00 last changed 178 months ago
[Voted into WP at March, 2010 meeting.]
Proposed resolution (February, 2010):
Change the final three lines of the second example in 13.4.4 [temp.arg.template] paragraph 2 as follows:
Y<A> ya; //ill-formed: a template parameter pack does not match a template parameterOK Y<B> yb; //ill-formed: a template parameter pack does not match a template parameterOK Y<C> yc; // OK
According to 13.4.4 [temp.arg.template] paragraph 3,
A template-argument matches a template template-parameter (call it P) when each of the template parameters in the template-parameter-list of the template-argument's corresponding class template or template alias (call it A) matches the corresponding template parameter in the template-parameter-list of P. When P's template-parameter-list contains a template parameter pack (13.7.4 [temp.variadic]), the template parameter pack will match zero or more template parameters or template parameter packs in the template-parameter-list of A with the same type and form as the template parameter pack in P (ignoring whether those template parameters are template parameter packs).
The immediately-preceding example, however, assumes that a parameter pack in the parameter will match only a parameter pack in the argument:
template<class T> class A { /* ... */ }; template<class T, class U = T> class B { /* ... */ }; template<class ... Types> class C { /* ... */ }; template<template<class ...> class Q> class Y { /* ... */ }; Y<A> ya; // ill-formed: a template parameter pack does not match a template parameter Y<B> yb; // ill-formed: a template parameter pack does not match a template parameter Y<C> yc; // OK
History | |||
---|---|---|---|
Date | User | Action | Args |
2010-03-29 00:00:00 | admin | set | messages: + msg2733 |
2010-03-29 00:00:00 | admin | set | status: tentatively ready -> cd2 |
2010-02-16 00:00:00 | admin | set | messages: + msg2509 |
2010-02-16 00:00:00 | admin | set | status: drafting -> tentatively ready |
2009-08-03 00:00:00 | admin | set | status: open -> drafting |
2008-11-02 00:00:00 | admin | create |