comp.lang.ada
 help / color / mirror / Atom feed
From: Jere <jhb.chat@gmail.com>
Subject: Re: Interest in standard smart pointers for Ada 2020
Date: Sat, 2 Sep 2017 07:03:40 -0700 (PDT)
Date: 2017-09-02T07:03:40-07:00	[thread overview]
Message-ID: <06eded64-5ae6-4f2f-b0e9-0e13a6d89b0d@googlegroups.com> (raw)
In-Reply-To: <73399847-b482-4442-a02f-1bf9c67b467b@googlegroups.com>

On Thursday, August 31, 2017 at 11:17:12 AM UTC-4, Lucretia wrote:
> 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.

Out of curiosity, what feature of auto_ptr are you looking for that isn't provided by unique_ptr.  It was designed to be a more efficient replacement of auto_ptr, and it has all of the auto_ptr semantics available to my knowledge.

      parent reply	other threads:[~2017-09-02 14:03 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-08-31 12:12 Interest in standard smart pointers for Ada 2020 Alejandro R. Mosteo
2017-08-31 12:48 ` Dmitry A. Kazakov
2017-09-03 11:18   ` Alejandro R. Mosteo
2017-09-03 12:45     ` Dmitry A. Kazakov
2017-08-31 15:17 ` Lucretia
2017-08-31 15:51   ` Peter Chapin
2017-08-31 18:57     ` Lucretia
2017-09-01  9:05   ` AdaMagica
2017-09-02 14:03   ` Jere [this message]
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox