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-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,7a180be12347b9d3 X-Google-Attributes: gid103376,public X-Google-Thread: 1108a1,7a180be12347b9d3 X-Google-Attributes: gid1108a1,public X-Google-ArrivalTime: 2002-02-21 01:04:10 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!newsfeed00.sul.t-online.de!t-online.de!news-lei1.dfn.de!news-ber1.dfn.de!fu-berlin.de!uni-berlin.de!tar-alcarin.cbb-automation.DE!not-for-mail From: dmitry@elros.cbb-automation.de (Dmitry A. Kazakov) Newsgroups: comp.lang.ada,comp.object Subject: Re: Merits of re-dispatching Date: Thu, 21 Feb 2002 09:04:08 GMT Message-ID: <3c74b2a0.415796@News.CIS.DFN.DE> References: <3c70b935.501062@News.CIS.DFN.DE> <3c721028.221281@News.CIS.DFN.DE> <3C748B15.7080005@mail.com> NNTP-Posting-Host: tar-alcarin.cbb-automation.de (212.79.194.111) X-Trace: fu-berlin.de 1014282249 4313856 212.79.194.111 (16 [77047]) X-Newsreader: Forte Free Agent 1.21/32.243 Xref: archiver1.google.com comp.lang.ada:20203 comp.object:34800 Date: 2002-02-21T09:04:08+00:00 List-Id: On Thu, 21 Feb 2002 05:49:10 GMT, Hyman Rosen wrote: >Dmitry A. Kazakov wrote: >> My interpretation was that if C++ dispatches then it treats the type >> as class wide,, otherwise as specific. Then the object is always >> treated as specific in all calls from destructor. So what? Maybe it is >> hard to simulate, but well possible to explain. > >I don't know what it is you think that C++ does, but in fact, all calls >to virtual methods in C++ are dispatching, unless you ask for a specifc >version using the pointer->CLASS::FUNCTION() notation. In constructors >and destructors, the type of the object is the type whose constructor >or destructor is running, and that is the type used for dispatching. OK, it dispatches as if it didn't. Therefore I say that it does not. What happens internally is of no interest. >If the compiler can deduce the actual type of an object in a dispatching >call, it is of course free to call the proper method directly, and it >may be the case that such deduction is easier in a constructor or >destructor, but that is completely irrelevant to understanding what is >happening from the language viewpoint. The viewpoint of C++ language, but I am not talking about C++ definition of "dispatch" and its implementation issues. >You may persist in maintaining your incorrect mental model of what is >going on, but the only effect will be to lead you astray in complicated >caes. I still prefer a model where types of objects are not arbitrarily changed [no matter physically or mentally] depending on what kind of method is used. Regards, Dmitry Kazakov