Or how about using the stl to provide the wrapper functor - Doug T. description but without the custom caller.
boost::shared_ptr<T> ptr( new T, std::mem_fun_ref(&T::deleteMe) );
boost::shared_ptr<S> ptr( new S, std::ptr_fun(lib_freeXYZ) );
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…