Problem with templates used in a class member.

Ram'on Garc'ia ramon@jl1.quim.ucm.es
Fri Sep 4 14:21:00 GMT 1998


On Fri, 4 Sep 1998, Alexandre Oliva wrote:
> `fn' is not a valid expression; you must write `&user::fn' to get a
> pointer to member.

I have read your references, and I agree with you (I do not have a copy of
the latest C++ standard, I have checked the public working paper of
December 1996. Anyway, as you acknowledge, using &user::fn should suceed,
but unfortunately it does not. And the fix is not easy, since GCC does not
know about the fn member until the class declaration is closed.

Interestingly, however, the following code does compile with GCC:

class A {
	const static int k = 50;
	char s[k];
};

because EGCS does not treat k as a normal class member.


Ramon





More information about the Gcc mailing list