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=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,eca91508b02e7e97 X-Google-Attributes: gid103376,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news4.google.com!proxad.net!feeder1-2.proxad.net!usenet-fr.net!gegeweb.org!news.ecp.fr!news.jacob-sparre.dk!pnx.dk!not-for-mail From: "Randy Brukardt" Newsgroups: comp.lang.ada Subject: Re: Amount of copying on returned constant objects Date: Tue, 19 Jun 2007 16:33:26 -0500 Organization: Jacob's private Usenet server Message-ID: References: <5dfsfnF1qav8bU1@mid.individual.net> <46730bf5$0$23134$9b4e6d93@newsspool1.arcor-online.net> <5dntd6F35jc57U1@mid.individual.net> <4676C27D.2050608@obry.net> <5dpp8pF35116bU1@mid.individual.net> NNTP-Posting-Host: static-69-95-181-76.mad.choiceone.net X-Trace: jacob-sparre.dk 1182288667 5293 69.95.181.76 (19 Jun 2007 21:31:07 GMT) X-Complaints-To: news@jacob-sparre.dk NNTP-Posting-Date: Tue, 19 Jun 2007 21:31:07 +0000 (UTC) X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1807 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1896 Xref: g2news1.google.com comp.lang.ada:16246 Date: 2007-06-19T16:33:26-05:00 List-Id: "Alex R. Mosteo" wrote in message news:5dpp8pF35116bU1@mid.individual.net... > Randy Brukardt wrote: ... > > What really would help would be a way for the container to know when the > > access was destroyed, but there isn't any obvious way to do that in Ada. > > I guess then that some reference counting companion type (or maybe making > Cursors tagged and more heavyweight) was discarded because the distributed > overhead? Cursors can be tagged if the implementation so choses, but that doesn't have an effect on the element access problem. For that you need something that allows direct dereferencing, and in Ada as it stands, that can only be an access type. Having a companion type would work if it was impossible to separate the access from the reference counter. But there is no way in Ada to have a visible access type that cannot be assigned out of its surrounding wrapper. (Which is why I said that Dmitry would say that redefinition of ".all" for a private type could solve the problem.) Randy.