Article View: comp.os.ms-windows.programmer.tools.misc
Article #10Re: [Q] Why doesn't this compile?
From: Ranko Orlic
Date: Thu, 18 Apr 1996 07:10
Date: Thu, 18 Apr 1996 07:10
21 lines
1584 bytes
1584 bytes
> You cannot call a non-static member function without specifying > an object. The way you've written this, there is no way for B::L::f() > to set its "this" pointer. Of course, if this is really what you want > to do, the declaration of B::L::f() is unnecessary, since B::L > inherits the A::L::f() virtual method from its base class. > > | John Arisco <arisco@tradewave.com> Dear John, (where have I heard this song before, Status Quo perhaps?) a) It was just an example, in real life I'd called the base class implementation A::L::f() and done something useful in addition. b) B::L::f() IS a regular member function, not a static one, so the compiler does have a this pointer! The problem is the compiler which thinks is a static member function. I've tried it on other compilers (on both Mac and Sun), and they have no trouble with it. Regards, -- Ranko. PS. thanks anyhow for your response
Technical Details
Message-ID:
<3175EAD9.52CD@eps.agfa.be>Path:
arc1-ca.pugleaf.net!garfield.eps.agfa.be!lvhoofReferences:
<317523C0.5042@eps.agfa.be> <4l3cpv$l74@helium.einet.net>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!garfield.eps.agfa.be!lvhoof From: Ranko Orlic <rorlic@eps.agfa.be> Newsgroups: comp.os.ms-windows.programmer.tools.misc,comp.os.ms-windows.programmer.win32,comp.os.ms-windows.programmer.misc,comp.lang.c++ Subject: Re: [Q] Why doesn't this compile? Date: Thu, 18 Apr 1996 09:10:17 +0200 Organization: Agfa-Gevaert NV. Message-ID: <3175EAD9.52CD@eps.agfa.be> References: <317523C0.5042@eps.agfa.be> <4l3cpv$l74@helium.einet.net> NNTP-Posting-Host: brussels.eps.agfa.be Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Mailer: Mozilla 2.0 (WinNT; I) To: John Arisco <arisco@tradewave.com>