
"art" <art@deep-dream.com> writes:
Does intrusive_ptr work with overloading on any other compiler?
This is a general problem and as I proposed above to solve the ambiguity you have to use SFINE in template constructor of intrusive_ptr/shared pointer.
template< class T2 > shared_ptr( const shared_ptr<T2>& s_ptr, typename enable_if<is_convertible<T*,T2*>::result, void* >::type = 0) { ... }
I think it should be added to boost smartptr.
That isn't really a complete solution: struct Base {}; struct Derived : Base {}; struct Bottom : Derived {}; int f(shared_ptr<Base>); // #1 int f(shared_ptr<Derived>); // #2 shared_ptr<Bottom> x(new Bottom); int y = f(x); // Should call #2, but is ambiguous will still fail, and there's not really any way to make it work. -- Dave Abrahams Boost Consulting www.boost-consulting.com