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=unavailable autolearn_force=no version=3.4.4 Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!news.eternal-september.org!news.eternal-september.org!news.eternal-september.org!feeder.eternal-september.org!news.swapon.de!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail From: Niklas Holsti Newsgroups: comp.lang.ada Subject: Re: Quick question regarding limited type return syntax Date: Mon, 04 Aug 2014 20:49:06 +0300 Organization: Tidorum Ltd Message-ID: References: <166aaec5-5e9c-40e0-9b07-9b9c7d5f7f33@googlegroups.com> <16a6846f-2964-438a-ab9b-2029075f7924@googlegroups.com> <20m59uxjlygw$.2mpabkt469vp.dlg@40tude.net> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Trace: individual.net ic81DrEvGd1s3PtBC2JKuw6YAeWI3sXY4tZOgJmyTZJDBvrUtg Cancel-Lock: sha1:JMTmyXjKXHnE8ufpJP/Qjz4aSuA= User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.8; rv:24.0) Gecko/20100101 Thunderbird/24.6.0 In-Reply-To: Xref: news.eternal-september.org comp.lang.ada:21449 Date: 2014-08-04T20:49:06+03:00 List-Id: On 14-08-04 14:39 , Peter Chapin wrote: > On 2014-08-04 06:42, G.B. wrote: > >> C++, I think, lets "this" stand for the type at the current "level" >> during construction, so there is no dispatching to lower levels IIUC; >> however, Stroustrup mentions some pointer tricks that let the >> programmer circumvent the restriction. > > It's true that in C++ dynamic dispatch is "turned off" during the > execution of a constructor (and destructor). This is precisely to > prevent the use of an uninitialized object when a base subobject is > being constructed (or destroyed). It's a feature! It seems to me that > circumventing it would be like circumventing the type system. It is a circumvention of the C++ type (or class) system because it has been made so intentionally, by the logical meaning given to constructors in the language. > You might > be able to do it but... it would be a big warning flag that something is > wrong. "Wrong" from the point of view of the C++ object philosophy, yes, but IMO not necessarily wrong for the Ada object philosophy, where the Initialize primitive does not have such a strong predefined meaning (which is just what Dmitry complains about). -- Niklas Holsti Tidorum Ltd niklas holsti tidorum fi . @ .