Boost Users :
From: Ion Gaztañaga (igaztanaga_at_[hidden])
Date: 2008-05-21 11:27:28
Swadhin Bhide wrote:
> Is it possible to store CBaseObject* (base class
> pointers) in slist, hashtable, rbtree and avl tree?
No. Intrusive containers store (actually link) objects that have a
member or base hook.
> I am deriving CBaseObject from slist_base_hook,
> set_base_hook etc. But when using member_hook
> <CBaseObject*,...) and rbtree<CBaseObject*,...>,
> I am getting compiler errors. Boost documentation provides
> examples about objects and smart pointers.
boost::intrusive::list<CBaseObject> offers the same functionality as
storing pointers in a standard list. If you call:
You will call to virtual functions, even if the container is
> But can we store raw pointers in intrusive containers?
For an example where base and derived classes are stored in an intrusive
Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net