[smart_ptr] shared_count allocator

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. Can I do that in boost trunk? Or may be in a future versions of the boost? -- With best regards, Alexey Badyaev Russian Federation, Kemerovo

Alexey, hi!
On Mon, Feb 6, 2012 at 10:26 AM, Alexey Badyaev
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.
http://www.boost.org/doc/libs/1_47_0/libs/smart_ptr/shared_ptr.htm#allocator...
There is a constructor overload:
template

Ovanes Markarian пишет:
Take a look at synopsis. http://www.boost.org/doc/libs/1_47_0/libs/smart_ptr/shared_ptr.htm#allocator...
There is a constructor overload:
template
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.
Thank you! I must re-read manual of boost now....
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?
O, this is good question, I want know answer :-) -- With best regards, Alexey Badyaev Russian Federation, Kemerovo
participants (2)
-
Alexey Badyaev
-
Ovanes Markarian