Is this a bug, or some requirement (that I couldn't find) that if you ever pass "false" to the constructor, then that intrusive_ptr is assumed to never go out of scope?
http://boost.org/libs/smart_ptr/intrusive_ptr.html#constructors
The above link only has this to say:
constructors
intrusive_ptr(); // never throws Postconditions: get() == 0.
Throws: nothing.
intrusive_ptr(T * p, bool add_ref = true); Effects: if(p != 0 && add_ref) intrusive_ptr_add_ref(p);.
Postconditions: get() == p.
intrusive_ptr(intrusive_ptr const & r); // never throws template<class Y> intrusive_ptr(intrusive_ptr<Y> const & r); // never throws Effects: if(r.get() != 0) intrusive_ptr_add_ref(r.get());.
Postconditions: get() == r.get(). Hardly a reference to "factory" or that "someone else" has already taken ownership ...
add_ref == false means that you (or someone else) already called addr ef on the pointer. It's typically used with factory functions that return addref'ed pointers.
That settles it then. I just cannot use intrusive_ptr. Since shared_ptr is already ruled out, well .... roll-my-own-time, I guess ... Too bad for my use of boost. Many thanks. -- JFB