Created on 1998-01-28.00:00:00 last changed 306 months ago
Rationale (04/99): The Standard does not describe the meaining of multiple template keywords in this context, so the example should be considered as resulting in undefined behavior according to Clause 3 [intro.defs] “undefined behavior.”
Is the second explicit instantiation below well-formed?
template <class T> struct A { template <class T2> void f(T2){} }; template void A<int>::f(char); // okay template template void A<int>::f(float); // ?Since multiple "template<>" clauses are permitted in an explicit specialization, it might follow that multiple "template" keywords should also be permitted in an explicit instantiation. Are multiple "template" keywords not allowed in an explicit instantiation? The grammar permits it, but the grammar permits lots of stuff far weirder than that. My opinion is that, in the absence of explicit wording permitting that kind of usage (as is present for explicit specializations) that such usage is not permitted for explicit instantiations.
Rationale (04/99): The Standard does not describe the meaining of multiple template keywords in this context, so the example should be considered as resulting in undefined behavior according to Clause 3 [intro.defs] “undefined behavior.”
History | |||
---|---|---|---|
Date | User | Action | Args |
1999-09-14 00:00:00 | admin | set | messages: + msg198 |
1999-09-14 00:00:00 | admin | set | status: drafting -> nad |
1998-01-28 00:00:00 | admin | create |