This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Static data members in template declarations
> Should we wait to figure out whether this the same `f' until we
> instantiate S, and determine whether or not T::X is the same as T*?
> This seems unreasonable to me.
This is not too different from
template <class T>
struct S {
void f(T*);
void f(typename T::X);
};
template <class T>
void S<T>::f(typename T::X) {}
template <class T>
void S<T>::f(T*) {}
struct U{
typedef U* X;
};
S<U> v;
We already determine that T::X is T* at instantiation time, as a side
effect of noticing that S<U> has two identical members.
Regards,
Martin