|
Boost : |
From: Schoenborn, Oliver (Oliver.Schoenborn_at_[hidden])
Date: 2003-07-01 23:06:21
> On Tuesday, July 1, 2003, at 08:21 PM, Schoenborn, Oliver wrote:
>
> >> On Tuesday, Jul 1, 2003, at 17:36 America/Denver, Schoenborn, Oliver
> >> wrote:
> >>>>
> >>>> On Tuesday, Jul 1, 2003, at 14:38 America/Denver, Boost wrote:
> >>>>
> >>>>> Why is there no strict-ownership smart-pointer in boost?
> >>>>> Just curious to know what the reasons are. Thanks,
> >>>>
> >>>> What do want beyond what boost::scoped_ptr and
> >>>> std::auto_ptr provide?
> >>>
> >>> Ability to be used in STL containers, and explicit transfer of
> >>> ownership capabilities (e.g. *no* move-on-copy etc).
> >>
> >> So what would the copy semantics be?
> >
> > No copy allowed, except temporarily when inside the container to
> > insert or re-order or transfer from one container to another.
> > Oliver
>
> You may be looking for something that just doesn't exist in the
> language yet:
>
> http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/papers/2002/
> n1377.htm#move_ptr%20Example
It will certainly help. In the meantime however...
> I have experimented (actual working code) with what you're
> looking for. But the tools are *experimental* and not ready for prime
> time public use.
So have I. Check out the DynObj class in the NoPtr library at
noptrlib.sourceforge.net (which provides smart ref rather than smart
pointer, but that`s irrelevant to the issue).
> NTL ( http://www.ntllib.org/ ) claims to have this today (I think). I
> haven't looked at it closely enough to give a good review, but you
> might give it a go.
Interesting ideas but a number of things would be a problem for many, at
least at first glance (only random access, move semantics for container
copy, etc).
Oliver
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk