Go4Expert

Go4Expert (http://www.go4expert.com/)
-   C++ (http://www.go4expert.com/forums/cpp/)
-   -   Inheritance in STL (http://www.go4expert.com/forums/inheritance-in-stl-t18082/)

iskhan 18Jun2009 13:35

Inheritance in STL
 
Why STL is not incorraging inheritance?

shabbir 18Jun2009 14:45

Re: Inheritance in STL
 
Any modern world software development process also suggest to avoid Inheritance as its very tightly coupled relationship.

iskhan 18Jun2009 16:15

Re: Inheritance in STL
 
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?

shabbir 18Jun2009 16:44

Re: Inheritance in STL
 
Inheritance has its own kind of problem and one of the famous and very basic is multiple inheritance.

iskhan 19Jun2009 10:07

Re: Inheritance in STL
 
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.

Aesop 20Jun2009 05:25

Re: Inheritance in STL
 
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.


All times are GMT +5.5. The time now is 02:14.