I have a question about a code that I have recently took in my hands. I just want to know if in C++ templates paradigm it is correct or useful to do the following inheritance (just 3 classes as an example):
template< class I, class P, class D, unsigned int ID = 0 >
class PathFilter : public Filter< I, P, 1 >
{
...
}
template< class I, class A, unsigned int N = 1 >
class Filter : public Algorithm< I, A >
{
...
}
template< class I, class A >
class Algorithm : public A //This line
{
...
}
My question is specifically about the inheritance in the third example. Is it useful to make it so 'generic' and not precise? It is a good choice to compromise understandable code by a more generic code?
I ask firstly because I'm not an expert in C++ templates, but also because I see this code difficult to understand using templates (usually the names of the templates say nothing about its content). Any advice?