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=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,342dcd67e9ca73ee X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news3.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!newspeer1.nwr.nac.net!newspeer.monmouth.com!newsfeed.icl.net!newsfeed.fjserv.net!news.mailgate.org!news-zh.switch.ch!switch.ch!news.hispeed.ch!linux2.krischik.com!news From: Martin Krischik Newsgroups: comp.lang.ada Subject: Re: tagged record child: override constructor? Date: Wed, 14 Sep 2005 18:10:13 +0200 Organization: Cablecom Newsserver Message-ID: <4763607.ynpINh8cNq@linux1.krischik.com> References: <1126591134.797303.318920@z14g2000cwz.googlegroups.com> <1uri5gd2n7om0.1ujkzb26ayxdx.dlg@40tude.net> <1126625009.709876.226260@f14g2000cwb.googlegroups.com> <225337460.SlYKbeB8eD@linux1.krischik.com> <87vf14him5.fsf@ludovic-brenta.org> NNTP-Posting-Host: 84-73-3-68.dclient.hispeed.ch Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7Bit X-Trace: news.hispeed.ch 1126714515 32593 84.73.3.68 (14 Sep 2005 16:15:15 GMT) X-Complaints-To: news@hispeed.ch NNTP-Posting-Date: Wed, 14 Sep 2005 16:15:15 +0000 (UTC) User-Agent: KNode/0.9.2 Xref: g2news1.google.com comp.lang.ada:4665 Date: 2005-09-14T18:10:13+02:00 List-Id: Ludovic Brenta wrote: > Martin Krischik writes: >> That's because all class members are virtual in Ada. > > I think this needs to be elaborated on. > > All _primitive operations of a tagged type_ are _potentially_ > "virtual" in Ada. Each caller of such a primitive operation decides, > at the call site, whether the dispatching is static or dynamic. > In contrast, in (my recollection of) C++, all virtual methods dispatch > dynamically from all call sites: the decision is not made at the point > of call but at the point of definition of the method. In theory: No, C++ will staticly call function when possible. In praxis: In 99% of the time there is only a pointer/reference available and C++ need to dispatch then. You see the point of a virtual function that there are child classes (unlike i.E. string<> where there are no child classes). Since C++ has no 'Class all child classes need to be dealt by pointer/reference use. so you need to dispatch most of the time Martin -- mailto://krischik@users.sourceforge.net Ada programming at: http://ada.krischik.com