Boost logo

Boost :

Subject: Re: [boost] [interest] rich-typed smart pointers
From: Larry Evans (cppljevans_at_[hidden])
Date: 2013-10-05 16:10:33

On 10/02/13 13:34, Julian Gonggrijp wrote:
> Dear Boost members,
> I have designed a smart pointer that relies on the type system to
> offer safe and flexible automatic memory management at no runtime
> cost. It combines single ownership as in std::unique_ptr and reliable
> access from multiple places as in std::shared_ptr with some additional
> features. I believe it to be about as safe and practically useful as a
> smart pointer in C++11 could get.
> Further explanation and a proof-of-concept implementation is available
> over here:
If there were a templated owned_ptr CTOR:

     template<typename Derived>
     owner_ptr (owner_ptr<Derived> && source) : pointer(source.pointer) {
         source.pointer = nullptr;

wouldn't that eliminate the need for the make_dynamic templated function?

Just wondering. I haven't tried it, but I'd guess it would work because
the ownd_ptr<Derived> could be constructed with the:


and then the templated owned_ptr CTOR would then convert that to the
base class?


Boost list run by bdawes at, gregod at, cpdaniel at, john at