Boost logo

Boost Users :

From: Peter Dimov (pdimov_at_[hidden])
Date: 2008-03-27 13:25:08


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 <boost/intrusive_ptr.hpp>
>
> 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>.


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net