2

The following code gives a compilation error in VS2010, which support shared_ptr and make_shared function. Why and how to correct it?

#include <memory>

class A
{
    A(std::shared_ptr<int> p = std::make_shared<int>())   // error is at this line
    {}
};

It shows "make_shared" is not a member of "global namespace".

user1899020
  • 13,167
  • 21
  • 79
  • 154

0 Answers0