From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-0.3 required=5.0 tests=BAYES_00, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,56131a5c3acc678e X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2003-12-08 11:40:12 PST Path: archiver1.google.com!news2.google.com!newsfeed2.dallas1.level3.net!news.level3.com!crtntx1-snh1.gtei.net!news.gtei.net!newsfeed1.easynews.com!easynews.com!easynews!newspeer1.nwr.nac.net!colt.net!peernews3.colt.net!newsfeed00.sul.t-online.de!newsmm00.sul.t-online.com!t-online.de!news.t-online.com!not-for-mail From: Martin Krischik Newsgroups: comp.lang.ada Subject: Re: Question about OO programming in Ada Date: Mon, 08 Dec 2003 20:33:20 +0100 Organization: AdaCL Message-ID: <1998676.6fRVD2dq80@linux1.krischik.com> References: <5JmdnUF_9o_ABE-iRTvUrg@rapidnet.com> <1273941.m4G3ZzughP@linux1.krischik.com> Reply-To: krischik@users.sourceforge.net Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7Bit X-Trace: news.t-online.com 1070912245 03 9724 Pe8sG2q6sflQYn4 031208 19:37:25 X-Complaints-To: usenet-abuse@t-online.de X-ID: ThVOp+ZbYeL+B4BRfUbsG6VJY0Oa5pXmGuCvdYfimZi7q4r4Jz5hQj User-Agent: KNode/0.7.2 Xref: archiver1.google.com comp.lang.ada:3238 Date: 2003-12-08T20:33:20+01:00 List-Id: Dmitry A. Kazakov wrote: > On Mon, 08 Dec 2003 08:42:28 GMT, Hyman Rosen > wrote: > class X > { > public : > virtual void Foo (); > virtual void Baz () > { > Foo (); > } > Is the call to Foo from Baz dispatching? The answer is, well, > sometimes it will. No, the aswer is yes because you call: this->Foo (); and calls via pointer dispach. > [*] "this" is a class-wide pointer when Baz was not directly or > indirectly called from a constructor/destructor. It is a specific > pointer otherwise. This is why one should avoid calling virtual functions in conctructors or destructors. And if you need to you schould consider making the call non dispaching: X::Foo (); With Regards Maritn -- mailto://krischik@users.sourceforge.net http://adacl.sourceforge.net