class MyClass {
public:
MyClass(std::weak_ptr<MyClass> parent){}
}
i want to do this:
auto newInstance = std::make_shared<MyClass>(nullptr);
or default value of weak_ptr argument is null, such as :
void function(int arg,std::weak_ptr<MyClass> obj = nullptr);
but, what i need is to do this instead:
auto newInstance = std::make_shared<MyClass>(std::shared_ptr<MyClass>(nullptr));
why is that?