
11 Apr
2008
11 Apr
'08
4:11 p.m.
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.