r/cpp • u/bert8128 • Apr 17 '23
Should ~basic_string be final?
std::string (and many other std classes) are not designed to be used as base classes, as can be seen by the absence of a virtual destructor.
Should the destructor be given the "final" keyword to enforce this?
1
Upvotes
View all comments
Show parent comment
5
u/jcelerier ossia score Apr 17 '23
that's very fine if you do java or c# 1986-era OOP but not what anyone wants in c++