
27 Mar
2008
27 Mar
'08
9:27 p.m.
Peter Dimov
This doesn't answer your question, but if you add
void intrusive_ptr_add_ref( A* ); void intrusive_ptr_release( A* );
you can copy intrusive_ptr<A> instances around freely. This achieves a level of incomplete type support that matches shared_ptr<A>.
I think this gives some linker error. In our code we often use a refcount base class, e.g: class A : public RefCount { }; for the RefCount class has the functions are defined: void intrusive_ptr_add_ref( RefCount* ); void intrusive_ptr_release( RefCount* ); and there is the problem: a fwd decl. is not enough for the compiler to figure out that a matches the RefCount functions.