I have created 2 separate template classes VEC and MAT. However, I just came across a library where the MAT (matrix) class is implemented and as VEC is just a special case of MAT, they just derive VEC from MAT and it inherits most of the functions. I have not had much experience with inheritance and templates, in a simple case how could this be done?