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!news4.google.com!news.glorb.com!solnet.ch!solnet.ch!news-zh.switch.ch!switch.ch!cern.ch!news From: Maciej Sobczak Newsgroups: comp.lang.ada Subject: Re: tagged record child: override constructor? Date: Wed, 14 Sep 2005 11:05:10 +0200 Organization: CERN - European Laboratory for Particle Physics Message-ID: 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> <1idpvzxcxfckw.mrs8nw3eu4ks$.dlg@40tude.net> NNTP-Posting-Host: abpc10883.cern.ch Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Trace: sunnews.cern.ch 1126688709 7311 (None) 137.138.37.241 X-Complaints-To: news@sunnews.cern.ch User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.10) Gecko/20050913 Red Hat/1.7.10-1.4.2.SL3 X-Accept-Language: en-us, en In-Reply-To: <1idpvzxcxfckw.mrs8nw3eu4ks$.dlg@40tude.net> Xref: g2news1.google.com comp.lang.ada:4651 Date: 2005-09-14T11:05:10+02:00 List-Id: Dmitry A. Kazakov wrote: > C++ model is more tricky and in some aspects more limited. Only the prefix > (distinguished) parameter can be controlled (the "this-parameter".) There is a distinction between static and dynamic type and also a distinction between class member non-static functions and free functions as well as between non-static member functions being virtual or not. The "first" parameter causes the virtual dispatch on the dynamic type of the object when it is used as a prefix for a virtual member function. In all other cases (including further parameters) it is the static type of the object that drives the dispatch. > There is no difference between T and > T'Class (the source of countless problems.) Could you elaborate? > So all operations re-dispatch What does that mean? > except for constructors and destructors, which don't. They do, but there the dynamic and static type of the object is the same, which actually saves a lot of problems. > I.e. it is rather C++ > where the call site determines whether a virtual function dispatches. It always does, independent on the call site. It is rather the dynamic type of the object that changes during construction and destruction, thus leading to the "virtual functions don't work" impression. -- Maciej Sobczak : http://www.msobczak.com/ Programming : http://www.msobczak.com/prog/