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=-0.3 required=5.0 tests=BAYES_00, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: 103376,6dcdd5b561500c28 X-Google-Attributes: gid103376,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news1.google.com!npeer02.iad.highwinds-media.com!news.highwinds-media.com!feed-me.highwinds-media.com!cyclone1.gnilink.net!gnilink.net!nx02.iad.newshosting.com!newshosting.com!newsfeed.icl.net!newsfeed.fjserv.net!newsfeed.ision.net!newsfeed2.easynews.net!ision!news.belwue.de!newsfeed.arcor.de!newsspool1.arcor-online.net!news.arcor.de.POSTED!not-for-mail From: "Dmitry A. Kazakov" Subject: Re: smart pointer dangerous (no -> operator) Newsgroups: comp.lang.ada User-Agent: 40tude_Dialog/2.0.15.1 MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Reply-To: mailbox@dmitry-kazakov.de Organization: cbb software GmbH References: <49707299$0$32667$9b4e6d93@newsspool2.arcor-online.net> Date: Fri, 16 Jan 2009 13:43:15 +0100 Message-ID: NNTP-Posting-Date: 16 Jan 2009 13:43:16 CET NNTP-Posting-Host: 11b61132.newsspool3.arcor-online.net X-Trace: DXC=KJ@fGHab:V>gP]QSEBQ^d4McF=Q^Z^V384Fo<]lROoR1^YC2XCjHcb91k1BXNbGj`4DNcfSJ;bb[5IRnRBaCd<]h X-Complaints-To: usenet-abuse@arcor.de Xref: g2news1.google.com comp.lang.ada:3381 Date: 2009-01-16T13:43:16+01:00 List-Id: On Fri, 16 Jan 2009 12:42:17 +0100, Georg Bauhaus wrote: > Dmitry A. Kazakov schrieb: >> On Fri, 16 Jan 2009 11:04:57 +0100, Oliver Kowalke wrote: >> >>> Ada doesn't support the dereference operator -> as C++. >>> >>> So Ada provides only two ways to access the managed object? > >> Two major problems are: >> >> 1. Lack of delegation in order to automate generation of wrappers like Foo. >> 2. Lack of MI, because one base type is required and used further extension >> of the target type becomes practically impossible. > > Frequently overlooked, I think, Ada has nested scopes, useful > in many ways here. This is an unrelated issue. Referential semantics is not necessarily about object life time management. Surely a better support provided by Ada for stack allocated objects eliminates some cases of smart pointers typical in C++. But the problem of referential objects exists independently on that. Yes, if Ada had abstract access types, the positions 1 and 2 would be not needed in this concrete case, because built-in access types in Ada already "delegate" to the target, when operation "." is used. But Ada lacks abstract access types either. See last month's discussion: "Run-time accessibility checks (was: Construction initialization problem)" -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de