Summary

 < Day Day Up > 



Dynamic polymorphism is a powerful concept that lets you treat related objects orthogonally via a common inherited interface. The language features that enable dynamic polymorphic behavior include abstract base classes, pure virtual functions, public inheritance, derived classes, derived class objects, function overriding, and base class pointers to derived class objects.

An abstract base class provides one or more pure virtual functions that must be implemented somewhere in the inheritance hierarchy. A derived class can provide an implementation for a pure virtual function declared in its base class or it might not, in which case the derived class becomes an abstract base class.

Virtual destructors are necessary to ensure the proper destruction of objects in the inheritance hierarchy. A compiler-supplied destructor is not a virtual destructor.

The C++ language is very complex. Until you master its rules it will be helpful to think in terms of language features and the behaviors resulting from their use.



 < Day Day Up > 



C++ for Artists. The Art, Philosophy, and Science of Object-Oriented Programming
C++ For Artists: The Art, Philosophy, And Science Of Object-Oriented Programming
ISBN: 1932504028
EAN: 2147483647
Year: 2003
Pages: 340
Authors: Rick Miller

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net