This is the mail archive of the egcs@egcs.cygnus.com mailing list for the EGCS project. See the EGCS home page for more information.


[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index] [Subject Index] [Author Index] [Thread Index]

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



On Feb 17, 1999, "M.Cvjetko" <cvjetko@rt.e-technik.uni-erlangen.de> wrote:

> 	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.

> template<class T > typedef void (X<T>::*Ptr_to_f)();

There's no such thing as a template typedef.

typedef void (X<type>::*ptr)();

> template<class T > Ptr_to_f f_ptr_ = &X<T>::f;

Nor template variables in namespace scope.

ptr foo = &X<type>::f;

-- 
Alexandre Oliva  http://www.dcc.unicamp.br/~oliva  aoliva@{acm.org}
oliva@{dcc.unicamp.br,gnu.org,egcs.cygnus.com,samba.org}
Universidade Estadual de Campinas, SP, Brasil