Boost logo

Boost Users :

Subject: [Boost-users] [shared_ptr] Member functions as deallocators
From: Michael Crawford (mbcrawfo_at_[hidden])
Date: 2009-06-03 09:52:34


I'm using shared_ptr to hold a SceneManager object. In this particular
case, I don't actually want the shared_ptr to have ownership of the
SceneManager, but rather take advantage of it to insure that the
SceneManager it holds is cleared when the containing object (a game's state)
is destroyed. The deallocator needs to call SceneManager::clearScene, but
it needs to call it on the held object, so the deallocator call would be
essentially
(pointer held in shared_ptr)->clearScene( );
Can anyone give me some guidance on how to accomplish this?
Thanks,
MBC



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