Exactly. Ime most classes are not designed to be inherited but want to expose a clean public API.
While true that all classes can be inherited, treating _all_ classes with the assumption that they will be would just lead to a labyrinth of code.
While true that all classes can be inherited, treating _all_ classes with the assumption that they will be would just lead to a labyrinth of code.
> While true that all classes can be inherited
That's what the 'final' keyword in C++ is for: https://en.cppreference.com/w/cpp/language/final.html
"Specifies that a virtual function cannot be overridden in a derived class, or that a class cannot be derived from."