using namespace boost;
class A {};
class B : public A {};
class X {
virtual shared_ptr<A> foo();
};
class Y : public X {
virtual shared_ptr<B> foo();
};
The return types aren't covariant (nor are they, therefore, legal), but they would be if I was using raw pointers instead. What's the commonly accepted idiom to work around this, if there is one?