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.107.46.30 with SMTP id i30mr2936163ioo.59.1504192630854; Thu, 31 Aug 2017 08:17:10 -0700 (PDT) X-Received: by 10.36.41.14 with SMTP id p14mr239905itp.6.1504192630796; Thu, 31 Aug 2017 08:17:10 -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!border1.nntp.ams1.giganews.com!border2.nntp.ams1.giganews.com!nntp.giganews.com!peer03.ams1!peer.ams1.xlned.com!news.xlned.com!peer01.am4!peer.am4.highwinds-media.com!peer01.iad!feed-me.highwinds-media.com!news.highwinds-media.com!u11no2582701qtu.1!news-out.google.com!j49ni1078qtc.1!nntp.google.com!v20no967690qtg.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Thu, 31 Aug 2017 08:17:10 -0700 (PDT) In-Reply-To: Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=2a02:c7d:3c35:b000:325a:3aff:fe0f:37a5; posting-account=L2-UcQkAAAAfd_BqbeNHs3XeM0jTXloS NNTP-Posting-Host: 2a02:c7d:3c35:b000:325a:3aff:fe0f:37a5 References: User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: <73399847-b482-4442-a02f-1bf9c67b467b@googlegroups.com> Subject: Re: Interest in standard smart pointers for Ada 2020 From: Lucretia Injection-Date: Thu, 31 Aug 2017 15:17:10 +0000 Content-Type: text/plain; charset="UTF-8" X-Received-Body-CRC: 610303187 X-Received-Bytes: 2257 Xref: news.eternal-september.org comp.lang.ada:47859 Date: 2017-08-31T08:17:10-07:00 List-Id: On Thursday, 31 August 2017 13:12:20 UTC+1, Alejandro R. Mosteo wrote: > I wonder if there would be interest in standardizing some usual smart > pointers for the next revision. I will try to state the problems. I hope > you'll point any misunderstandings on my part. Yes, I've had to write these in the past too. Royal pain to keep doing. > If we look at the cousin C++, the standard pointers there are: Cousin? > > unique_ptr [1] > > > Allows exactly one owner of the underlying pointer. Use as the default choice for POCO unless you know for certain that you require a shared_ptr. Can be moved to a new owner, but not copied or shared. I just had to look up POCO, seems to be Plain old CLR Object, don't think that's what you meant. I would add auto_ptr too, I've implemented one before, although I think Block_Pointer would be a better Ada name for it. Should be limited, initialised with extended return and frees the contents at the end of the block in which it was instantiated.