struct A { ~A() { std::cout << "~A()"; } }; struct B : A { ~B() { std::cout << "~B()"; } }; struct C : B { ~C() { std::cout << "~C()"; } }; int main() { std::shared_ptr<A> p(false ? new B() : new C()); return 0; }
B
shared_ptr
Login in to like
Login in to comment
or Read more about C++ Quizzes
Login in to like
Login in to comment