Hi guys,
I am trying to build a class template who is supposed to take an instance of another class template as parameter. Here's the idea :
Rough idea of the call in main():
const aClassTemplate<type> templateObjectName;
otherClassTemplate<type,> secondTemplateObjectName;
My .hpp declares the template with this line :
template <typename Type, const aClassTemplate<Type>& NameOfInstance>
The problem is that this doesn't seem to work. Even when compiling i get a 'linkage error', does anyone know how to do this properly ?
As asked, compliant code of actual class (content doesn't matter) :
template <typename Type, const ConPol<Type>& Div>
class ModPol : public Pol<Type>, public VectFix<Type, Div.size()>{
private:
protected:
public:
ModPol();
virtual ~ModPol();
};
Call in main():
const ConPol<int> poly;
ModPol<int, &poly> modpoly;
Actual error:
error: non-type template argument refers to object 'poly'
that does not have linkage