This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

[Q] dcl and def of a pointer to member function of a template class


/*
  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; 




Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]