This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: glossary for egcs - request for contributions
- To: Joe Buck <jbuck at Synopsys dot COM>
- Subject: Re: glossary for egcs - request for contributions
- From: Alexandre Oliva <oliva at dcc dot unicamp dot br>
- Date: 29 Apr 1999 04:12:27 -0300
- Cc: espie at quatramaran dot ens dot fr (Marc Espie), egcs at egcs dot cygnus dot com
- References: <199904290648.XAA11732@atrus.synopsys.com>
On Apr 29, 1999, Joe Buck <jbuck@Synopsys.COM> wrote:
> one may replace a class by a derived class. e.g. I can overload a virtual
^^^^
make that override
> typedef int (*PFDerived)(Derived&);
> int bfunc(Base&);
> PFDerived p = &bfunc;
> this is legal
No way! :-)
You can't touch types of arguments when casting function types. This
mechanism only works for pointers-to-members:
struct Base { void foo(); };
struct Derived : Base {};
typedef void (Derived::*PFDerived)();
PFDerived pD = &Base::foo;
--
Alexandre Oliva http://www.dcc.unicamp.br/~oliva IC-Unicamp, Bra[sz]il
{oliva,Alexandre.Oliva}@dcc.unicamp.br aoliva@{acm.org,computer.org}
oliva@{gnu.org,kaffe.org,{egcs,sourceware}.cygnus.com,samba.org}
*** E-mail about software projects will be forwarded to mailing lists