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
- To: "M.Cvjetko" <cvjetko@rt.e-technik.uni-erlangen.de>
- Subject: Re: [Q] dcl and def of a pointer to member function of a template class
- From: Alexandre Oliva <oliva@dcc.unicamp.br>
- Date: 20 Feb 1999 23:26:06 -0200
- Cc: egcs@egcs.cygnus.com
- Delivered-To: listarch-egcs@egcs.cygnus.com
- Delivered-To: mailing list egcs@egcs.cygnus.com
- In-Reply-To: "M.Cvjetko"'s message of "Wed, 17 Feb 1999 16:18:18 +0100 (MET)"
- Mailing-List: contact egcs-help@egcs.cygnus.com; run by ezmlm
- References: <Pine.HPP.3.95.990217161656.15588A-100000@rt05.e-technik.uni-erlangen.de>
- Sender: owner-egcs@egcs.cygnus.com
- Sender: oliva@araguaia.dcc.unicamp.br
- User-Agent: Gnus/5.070077 (Pterodactyl Gnus v0.77) XEmacs/20.4 (Emerald)
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