D
Dart
What are the major advantages of inheritance of a class of no virtual
functions, promoting code re-use? Thanks!
functions, promoting code re-use? Thanks!
Dart said:What are the major advantages of inheritance of a class of no virtual
functions, promoting code re-use? Thanks!
Dart said:What are the major advantages of inheritance of a class of no virtual
functions, promoting code re-use? Thanks!
Phlip said:Per the /Effective C++/ books, one should only inherit if one then overrides
a virtual method. Ultimately, the best way to share implementation is
delegation, not inheritance. Use that to permit the Liskov Substitution
Principle.
jeffc said:It's very possible, and valid, to have a design with inheritance where the
base class has no virtual functions, yet the Liskov Substitution Principle
still holds.
Claudio Puviani said:It's possible in controlled circumstances, but it's extremely contrived.
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.