Re: Class Template Inheritance

Originally Posted by
Peter_APIIT
I have seen many class template that inherits from a normal base class.
What is the advantages about this design ?
I used such a design for my image classes. The base class contains all of the functionality that is common to all image types, but contains no information about any specific type.
A template derives from this which defines a specific type of image from the template parameters (bit depth, number of planes).
The non-template base class allows me to access the common functionality polymorphically or store references or pointers to images without having to know the specific type.
"It doesn't matter how beautiful your theory is, it doesn't matter how smart you are. If it doesn't agree with experiment, it's wrong."
Richard P. Feynman