Inheritance in STL

iskhan's Avatar, Join Date: Jun 2009
Newbie Member
Why STL is not incorraging inheritance?
0
shabbir's Avatar, Join Date: Jul 2004
Go4Expert Founder
Any modern world software development process also suggest to avoid Inheritance as its very tightly coupled relationship.
0
iskhan's Avatar, Join Date: Jun 2009
Newbie Member
Inheritance is one of the key element in OOP so what is the other way?
If we use Inheritance in STL what kind of problems we face?
0
shabbir's Avatar, Join Date: Jul 2004
Go4Expert Founder
Inheritance has its own kind of problem and one of the famous and very basic is multiple inheritance.
0
iskhan's Avatar, Join Date: Jun 2009
Newbie Member
I know if we use multiple inheritance it may be possible "Deadly Diamond of Death" formed.but I need to know why inheritance is avoid to use in Standard Template Library??If we use it what kind of problem we face??I sure you understand my question.
0
Aesop's Avatar
Light Poster
If you are inheriting from a class, it should (usually) have a virtual destructor. But for efficiency reasons STL containers don't define virtual destructors.

So that's one reason. There may be others.