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,FREEMAIL_FROM autolearn=unavailable autolearn_force=no version=3.4.4 X-Received: by 10.129.92.69 with SMTP id q66mr6844961ywb.164.1491181490437; Sun, 02 Apr 2017 18:04:50 -0700 (PDT) X-Received: by 10.157.46.203 with SMTP id w69mr644432ota.5.1491181490399; Sun, 02 Apr 2017 18:04:50 -0700 (PDT) Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!news.eternal-september.org!news.eternal-september.org!feeder.eternal-september.org!1.eu.feeder.erje.net!feeder.erje.net!2.us.feeder.erje.net!weretis.net!feeder6.news.weretis.net!feeder.usenetexpress.com!feeder1.iad1.usenetexpress.com!border1.nntp.dca1.giganews.com!border2.nntp.dca1.giganews.com!nntp.giganews.com!n21no4658869qta.1!news-out.google.com!j72ni840itb.0!nntp.google.com!y18no3334659itc.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Sun, 2 Apr 2017 18:04:50 -0700 (PDT) Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=137.103.119.68; posting-account=ShYTIAoAAABytvcS76ZrG9GdaV-nXYKy NNTP-Posting-Host: 137.103.119.68 User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: <93d2cfb3-1518-4d99-8075-e636e1f32b5d@googlegroups.com> Subject: Constructing by classwide type From: sbelmont700@gmail.com Injection-Date: Mon, 03 Apr 2017 01:04:50 +0000 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Xref: news.eternal-september.org comp.lang.ada:46519 Date: 2017-04-02T18:04:50-07:00 List-Id: Can anyone offer advice on the pros and cons of having constructor function= s of extended types return their classwide parent in lieu of the concrete t= ype? Occasionally I find myself with an abstract parent type that is imple= mented by a broad number of children, none of which add any new primitive o= perations or are extended any further, and all of which are intended to be = used in the context of their (classwide) parent; in these cases, there seem= s to be several marginal benefits to returning the parent type, including t= hat nearly all declarations can be put into the body, it forces initializat= ion, the constructor doesn't become a primitive operation, it acts as a kin= d poor mans 'final' keyword, et al... None of it is earth-shattering, but apart from not having access to the und= erlying type (not necessarily a bad thing depending on circumstance), are t= here other downsides I've yet to discover? Thanks for any advice -sb