Boost logo

Boost :

From: Peter Dimov (pdimov_at_[hidden])
Date: 2008-04-11 12:11:21


Daniel Frey:

> I enhanced the example and added some comments. The reason for having a
> template tag class is that you can fix otherwise problematic cases when
> multiple tags are present.

I'm still not 100% convinced that we need this functionality in shared_ptr.
But if we do, it seems that the proper way to add it is to make shared_ptr
issue an unqualified call to

    sp_accept_owner( this, p );

which the user will now be free to add to the namespace of *p or one of its
base classes. Your code, for example, would now have

template<class T>
void sp_accept_owner(
    shared_ptr<T> * p, shared_ptr_debugger * q );

in the namespace of shared_ptr_debugger, and another overload in the
namespace of C4 that would resolve the ambiguity.


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk