I was digging through documentation of boost, looking for callback which is called just before object in boost::shared_ptr is being deleted, so i can write object state back to hard drive, and remove weak_ptr element from std::map.
¿Alguien sabe cómo lidiar con este problema?
preguntado el 25 de agosto de 12 a las 04:08
When the shared pointer is deleted it should call your objects destructor. You can write your object to the disk at that time, right there in its destructor.
You can pass a deleter function to shared ptr and write object state in this function.
template<class Y, class D> shared_ptr(Y * p, D d);