Boost logo

Boost Users :

Subject: Re: [Boost-users] [smart_ptr] shared_count allocator
From: Ovanes Markarian (om_boost_at_[hidden])
Date: 2012-02-06 12:34:17

Alexey, hi!

On Mon, Feb 6, 2012 at 10:26 AM, Alexey Badyaev <leemouse_at_[hidden]> wrote:

> Hi All.
> I see in sources of the boost/smart_ptr library: shared_count object is
> allocated by shared_ptr via operator new.
> But I don't want allocate this object on a heap memory, but via my own
> allocator.
Take a look at synopsis.

There is a constructor overload:

template<class Y, class D, class A> shared_ptr(Y * p, D d, A a);

As I understand it, this ctor will allocate internal shared_ptr resources
using an instance of Allocator A.

Can I do that in boost trunk? Or may be in a future versions of the boost?

Actually, this raises the question what will happen with boost::shared_ptr
after it made to C++11? Is it going to diverge from standard as an
additional feature experiment or go hand in hand with C++11 or become
obsolete for C++11 compilers?

With Kind Regards,

Boost-users list run by williamkempf at, kalb at, bjorn.karlsson at, gregod at, wekempf at