Created on 2000-05-04.00:00:00 last changed 208 months ago
[Voted into WP at April 2003 meeting.]
Proposed Resolution (4/02):
Elide the first use of the word "member" in 13.3 [temp.names] paragraph 5 so that its first sentence reads:
If a name prefixed by the keyword template is not the name of amembertemplate, the program is ill-formed.
Consider the following example:
template<class T>
struct X {
virtual void f();
};
template<class T>
struct Y {
void g(X<T> *p) {
p->template X<T>::f();
}
};
This is an error because X is not a member template; 13.3 [temp.names] paragraph 5 says:
If a name prefixed by the keyword template is not the name of a member template, the program is ill-formed.
In a way this makes perfect sense: X is found to be a template using ordinary lookup even though p has a dependent type. However, I think this makes the use of the template prefix even harder to teach.
Was this intentionally outlawed?
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2008-10-05 00:00:00 | admin | set | status: wp -> cd1 |
| 2003-04-25 00:00:00 | admin | set | messages: + msg873 |
| 2003-04-25 00:00:00 | admin | set | status: ready -> wp |
| 2002-11-08 00:00:00 | admin | set | status: review -> ready |
| 2002-05-10 00:00:00 | admin | set | messages: + msg633 |
| 2002-05-10 00:00:00 | admin | set | status: open -> review |
| 2000-05-04 00:00:00 | admin | create | |