8 Sep
2009
8 Sep
'09
9:28 p.m.
Hello, Is the following code legal and safe - a) according to the shared_ptr specs b) with the current boost::shared_ptr implementation Thanks! struct a { a() : p_(this, mem_fn(&a::delete_me)) {} void reset() { p_.reset(); } void delete_me() { delete this; } shared_ptr<a> p_; }; int main() { a* p = new a; p->reset(); }