
27 Mar
2008
27 Mar
'08
5:25 p.m.
gast128: ...
From the header file of intrusive_ptr it seems that it can deal with incomplete types. The constructor and destructor use the 'intrusive_ptr_add_ref' or 'intrusive_ptr_release'. If these are not invoked, use of an intrusive_ptr with incomplete types should be ok.
So it seems that below example will compile:
//foo.h: #include
class A;
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>.