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 X-Received: by 10.224.21.129 with SMTP id j1mr7710273qab.7.1407152353057; Mon, 04 Aug 2014 04:39:13 -0700 (PDT) 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!usenet.blueworldhosting.com!feeder01.blueworldhosting.com!peer02.iad.highwinds-media.com!news.highwinds-media.com!feed-me.highwinds-media.com!j15no4349930qaq.0!news-out.google.com!b3ni13776qac.1!nntp.google.com!Xl.tags.giganews.com!border1.nntp.dca.giganews.com!nntp.giganews.com!local2.nntp.dca.giganews.com!news.giganews.com.POSTED!not-for-mail NNTP-Posting-Date: Mon, 04 Aug 2014 06:39:12 -0500 Date: Mon, 04 Aug 2014 07:39:13 -0400 From: Peter Chapin User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:31.0) Gecko/20100101 Thunderbird/31.0 MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: Quick question regarding limited type return syntax References: <166aaec5-5e9c-40e0-9b07-9b9c7d5f7f33@googlegroups.com> <16a6846f-2964-438a-ab9b-2029075f7924@googlegroups.com> <20m59uxjlygw$.2mpabkt469vp.dlg@40tude.net> In-Reply-To: Message-ID: X-Usenet-Provider: http://www.giganews.com X-Trace: sv3-Ozl2i0N0zX/QQ+vZH6ZgDuhWYnTALjPQ693Yl/dITX9n2t5ma6ALIt6CO1BhQCiCG1NPP5pPeywH2s+!XU7TyQk99KiTU09AVXFACfYadMshQGCeuICo49i0LjpKT6sS4jaW69W93cNM7MA= X-Complaints-To: abuse@giganews.com X-DMCA-Notifications: http://www.giganews.com/info/dmca.html X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly X-Postfilter: 1.3.40 X-Original-Bytes: 2524 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Received-Bytes: 2826 X-Received-Body-CRC: 5454675 Xref: news.eternal-september.org comp.lang.ada:21438 Date: 2014-08-04T07:39:13-04:00 List-Id: 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. You might be able to do it but... it would be a big warning flag that something is wrong. Peter