boost::pool base class new override
hi
first question: where on earth was boost while I was doing my last year project?
just thinking of the amount of trouble I could have saved if I knew about it... makes me bang my head against several
walls ;)
Well, I starter looking towards memory managment with other eyes after 90% of my bugs being directly originated form it.
So after looking on the boost memory library a question popped: how can I use smart pointers and pool toguether. In
particular intrusive pointers and/or pool, being the "and/or" essencial.
If i have class C all made and ready and now I want it work with smart pointers i just have to make a base class
RefCount, use multiple inheritance to contruct C_RC and i can have both things.
Problem is, now i want to use it in pool too, but my base class RefCount calls delete. My solution; make yet another
base class Poolable and override new and delete there.
Well to my surprise it worked but only in very special cases. I have to use pool<> and cant use object_pool
participants (1)
-
Rodrigo Serafim