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,70414f56d810c10c X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Received: by 10.68.40.229 with SMTP id a5mr2580518pbl.21.1316504313514; Tue, 20 Sep 2011 00:38:33 -0700 (PDT) Path: lh7ni974pbb.0!nntp.google.com!news1.google.com!npeer02.iad.highwinds-media.com!news.highwinds-media.com!feed-me.highwinds-media.com!nx02.iad01.newshosting.com!newshosting.com!news2.euro.net!feeder.news-service.com!aioe.org!.POSTED!not-for-mail From: "Dmitry A. Kazakov" Newsgroups: comp.lang.ada Subject: Re: discriminant questions Date: Tue, 20 Sep 2011 09:38:15 +0200 Organization: cbb software GmbH Message-ID: <1b7pl1piwc3hl.7q9fyyq8h3m7.dlg@40tude.net> References: <9f37b726-d80b-4d24-bf3f-28a14255f7fd@s20g2000yql.googlegroups.com> <86015926-d652-4265-aedd-413312d399f9@dq7g2000vbb.googlegroups.com> <0d272f62-67d0-4905-972c-8a7e912c5531@en1g2000vbb.googlegroups.com> <148cxoyabima2.16mz6xwdph2hj.dlg@40tude.net> Reply-To: mailbox@dmitry-kazakov.de NNTP-Posting-Host: FbOMkhMtVLVmu7IwBnt1tw.user.speranza.aioe.org Mime-Version: 1.0 X-Complaints-To: abuse@aioe.org User-Agent: 40tude_Dialog/2.0.15.1 X-Notice: Filtered by postfilter v. 0.8.2 Xref: news1.google.com comp.lang.ada:18040 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Date: 2011-09-20T09:38:15+02:00 List-Id: On Mon, 19 Sep 2011 19:01:05 -0500, Randy Brukardt wrote: > "Dmitry A. Kazakov" wrote in message > news:148cxoyabima2.16mz6xwdph2hj.dlg@40tude.net... >> On Sat, 17 Sep 2011 15:55:15 -0700 (PDT), ytomino wrote: > ... >>> This code is same as: >>> >>> type Reference_Type (Element : access Integer) is null record; >> >> It is not same, and I don't see the purpose of using this construct. In >> any case it cannot serve as a good basis for smart pointers. > > The "good reason" for using this construct (beyond the obvious one of being > able to use the "implicit dereference" construct is one of lifetime. The > access discriminant of this object has the same lifetime as the enclosing > object; if that object is returned from a function, that is very short. That is why this cannot be used for smart pointers. For them the relationship is exactly opposite: Element always outlive the pointer except the last one. -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de