Menu

#1 Base classes without virtual destructor

open
nobody
None
5
2011-01-24
2011-01-24
No

I have noticed that a declaration like for the class "src/clouseau/Scope_Info.h" does not contain an explicit destructor. (It is not marked as "virtual".)

I see a non-virtual destructor usually as an indication that such a class is not intended for derivation. I guess that this design detail does not fit to the intention of your C++ class library.
http://www.devx.com/tips/Tip/14187
http://stackoverflow.com/questions/270917/why-should-i-declare-a-virtual-destructor-for-an-abstract-class-in-c
http://www.artima.com/forums/flat.jsp?forum=106&thread=107587
http://dietmar-kuehl.de/mirror/c++-faq/virtual-functions.html#faq-20.7

Discussion


Log in to post a comment.

MongoDB Logo MongoDB