Created on 2005-05-03.00:00:00 last changed 196 months ago
[Voted into WP at the October, 2006 meeting.]
Proposed resolution (October, 2005):
Replace the last sentence of 13.7.6.1 [temp.spec.partial.general] paragraph 1:
If a template is partially specialized then that partial specialization shall be declared before the first use of that partial specialization that would cause an implicit instantiation to take place, in every translation unit in which such a use occurs; no diagnostic is required.
with:
A partial specialization shall be declared before the first use of a class template specialization that would make use of the partial specialization as the result of an implicit or explicit instantiation in every translation unit in which such a use occurs; no diagnostic is required.
According to 13.7.6.1 [temp.spec.partial.general] paragraph 1,
If a template is partially specialized then that partial specialization shall be declared before the first use of that partial specialization that would cause an implicit instantiation to take place, in every translation unit in which such a use occurs; no diagnostic is required.
This leaves the impression that an explicit instantiation of the primary template may precede the declaration of an applicable partial specialization. Is the following example well-formed?
template<typename T> class X{ public: void foo(){}; }; template class X<void *>; template<typename T> class X<T*>{ public: void baz(); }; void bar() { X<void *> x; x.foo(); }
History | |||
---|---|---|---|
Date | User | Action | Args |
2008-10-05 00:00:00 | admin | set | status: wp -> cd1 |
2007-05-06 00:00:00 | admin | set | status: dr -> wp |
2006-11-05 00:00:00 | admin | set | messages: + msg1445 |
2006-11-05 00:00:00 | admin | set | status: ready -> dr |
2006-04-22 00:00:00 | admin | set | status: review -> ready |
2005-10-22 00:00:00 | admin | set | messages: + msg1250 |
2005-10-22 00:00:00 | admin | set | status: open -> review |
2005-05-03 00:00:00 | admin | create |