class myClass{
public:
myClass();
~myClass(){}
private:
std::shared_ptr<someClass> scObj;
};
myClass::myClass() : scObj(new someClass) //works{
scObj = new someClass; //<< error
scObj(new someClass); //<< error
}
The initialization list after the : works, but for the purpose of satisfying my curiosity, I would like to know why the other initialization methods do not work.
Thanks for your help!