I was told that there is no memory leak of B->b in the following code:
struct A {}; // no virtual destructor
struct B : public A {
int b;
}
int main() {
A* a = new B {};
delete a;
}
If it's true, could you explain why?