It seems I cannot get rid of this. I'm probably starting to look suspiciously annoying. Hope I'm not. Tell me when to stop.
I want to have my allocated memory managed. Period. And in this quest I've been bouncing on walls.
My latest, and hopefully last one has to to with boost::shared_ptr apparently not supporting dynamic binding. I need your help figuring out if this is indeed the case:
I'm getting so frustrated. Why isn't dynamic binding working? Is it because shared_ptr doesn't support it?Code:class CItem { public: typedef boost::shared_ptr<CItem> CItem_Ptr; virtual CItem& add(CItem_Ptr); } class CContainer : public CItem { public: virtual CContainer add(CItem_Ptr); } class CWeapon : public CItem { /* ... * / } int main() { CItem_Ptr weapon(new CWeapon) CItem_Ptr obj(new CContainer); obj->add(weapon) // This calls CItem::add. Not CContainer::add }