
Thanks for your reply... You're right, "reset" would delete the pointer... but when you're getting rid of a pointer obtained from a factory, like I was in my case, pointers don't always get disposed of using delete, but rather another function (like p->release()) And rather than writing special purpose smart pointers for each type of deleting function (p->dispose(), p->release(), api_function_free(p), etc..) you can use shared_ptr with a custom deleter (here: mem_fn(&pointer_type::dispose) or bind(&api_function_free, _1)) "tom gee" <rockonedge@gmail.com> wrote in message news:507cc4720501042126739a6f6d@mail.gmail.com...
If you intention is to release the pointer, reset(0) can achieve this. The document says: "void reset(T * p = 0); // never throws Deletes the object pointed to by the stored pointer and then stores a copy of p ".
With reset, you should be able assign another pointer.