1 May
2006
1 May
'06
11:28 p.m.
Suppose I have an auto_ptr, shared_ptr, or scoped_ptr. If I want to set it to null, I do this (assuming the pointer is named p): p.reset(); // okay If I try this, p = 0; // error I get an error during compilation. In other words, reset works, but assignment of the null pointer does not. But suppose p is an intrusive_ptr. Now p.reset(); // error fails, and p = 0; // okay succeeds. In other words, assignment works, but reset does not. I find this, er, unintuitive. Does anybody know why intrusive_ptr marches to its own nullifying drummer? Thanks, Scott