James, FYI doing the reset causes the deleter function to become invalid as far as I can tell. I don't quite understand this myself.
If you do e.g.:
unique_ptr<Foo, MyDeleter> o(nullptr, MyDeleter());
o.reset(new_foo()); // unique_ptr doesn't let you pass the deleter again here, presumably intentionally.
James, FYI doing the reset causes the deleter function to become invalid as far as I can tell. I don't quite understand this myself.
If you do e.g.:
unique_ptr<Foo, MyDeleter> o(nullptr, MyDeleter());
o.reset(new_foo()); // unique_ptr doesn't let you pass the deleter again here, presumably intentionally.
then unique_ptr causes a segfault on destruction.