Open winner245 opened 1 day ago
enable_shared_from_this should also work for shared_ptr objects created by constructors.
Please review the PR. Without this PR, the following code would not run:
SharedPtr p0(new StudentDerived("彭于斌", 23)); p0->func(); Student* mqb = new Student("mq白", 19); p0.reset(mqb); p0->func();
enable_shared_from_this should also work for shared_ptr objects created by constructors.