virtual destructor unexpected pass

Martin von Loewis martin@mira.isdn.cs.tu-berlin.de
Wed Sep 2 22:47:00 GMT 1998


> That way you won't get a head-scratching about "uh, but I declared
> it pure virtual, why is it calling a nonexistent function?" just
> like I did.

So you want your C++ compiler to teach you C++? It seems that people
using pure virtual destructors either know what they do, or don't
fully understand destructors in C++ in the first place. Derived-class
destructors *always* call base-class destructors.

Personally, I would have expected that destructors may not be pure,
and it may seem that they are there 'just for completeness'. So yes,
I'd agree that they are bad style in most situations.

Martin



More information about the Gcc-bugs mailing list