Boost logo

Boost Users :

From: gast128 (gast128_at_[hidden])
Date: 2008-03-27 17:27:30


Peter Dimov <pdimov <at> pdimov.com> writes:

>
> 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.


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