This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
[Q] dcl and def of a pointer to member function of a template class
- To: egcs at egcs dot cygnus dot com
- Subject: [Q] dcl and def of a pointer to member function of a template class
- From: "M.Cvjetko" <cvjetko at rt dot e-technik dot uni-erlangen dot de>
- Date: Wed, 17 Feb 1999 16:18:18 +0100 (MET)
/*
egcs@egcs.cygnus.com
Hi!
Well, I came up with one question:
I'd like to declare and define a pointer to a function of a
template class, but cannot find any examples of correct syntax for
declaring it.
The problem is by typedef declaration (I don't know how to declare
it
with template parameter).
Thank You very much for Your kindness.
miljenko
I tried something like that (several versions, but this is only one)
*/
template <class T >
class X
{
void f();
};
template<class T >
typedef
void
(X<T>::*Ptr_to_f)();
template<class T >
Ptr_to_f f_ptr_ = &X<T>::f;