Skip to main content

All Questions

Filter by
Sorted by
Tagged with
3 votes
1 answer
2k views

Augmenting functionality of subclasses without code duplication in C++

I have to add common functionality to some classes that share the same superclass, preferably without bloating the superclass. The simplified inheritance chain looks like this: Element -> ...
Rob W's user avatar
  • 135
9 votes
6 answers
13k views

When you use inheritance to reuse code, do you find it too tricky that it swallows the benifits of reuse?

I've been coding for about 8 years, however I still find inheritance is too flexible and sometimes it makes you totally confused with the code you have written. One simplest example would be: ...
tactoth's user avatar
  • 553