Well, I wrote a set of classes and a test program to measure the performance of the following different implementations:
- Class without any virtual function.
- Class with a virtual destructor.
- Class where the function that's called is defined virtual.
- Class with a virtual destructor and the function defined as virtual.
- Class derived from a base class (interface-like) which defined the function as pure virtual, and the implementation in the derived class.
So, use base classes and virtual functions and all the fancy features that C++ offers!
Keine Kommentare:
Kommentar veröffentlichen