1 Apr
2006
1 Apr
'06
4:04 p.m.
Hi,
I have an heterogeneous container holding pointers to objects of type B. I
want to insert objects of type D1,D2,... that derive from B, and I want to do
that using a custom stl like allocator, for example:
B* obj = my_alloc<D>::allocate(1);
obj = new (obj) B();
container.insert(obj);
My problem is that when an object is removed from the container, I have to
explicitely deallocate it from my allocator, but the static info was lost, so
I cannot do
my_alloc>::deallocate(1,oj);
I've asked in boost irc channel, and someone told me ptr_* boost libraries
solve this problem, is this correct?
thanks
--
Marco Correia