What am I doing wrong here? I cannot believe the below doesn't compile. Do you need to use a shared pointer cast or something?
struct Base
{
};
class Child : Base
{
};
int main()
{
std::shared_ptr<Base> p = std::make_shared<Child>();
}
The error I get with Microsoft compiler is
error C2440: 'initializing': cannot convert from 'std::shared_ptr<Child>' to 'std::shared_ptr<Base>'