A: I use something like this:
In Class1.h:
template <class T>
class Class1 : Database {
public:
Class1();
};
In Class1.cpp:
#include "Class1.h"
template <typename T>
Class1<T>::Class1(){
//Some code
}
Calling class:
#include "Class1.h"
Class1<Class2> *class1 = new Class1<Class2>();
If i run this, the linker is not able to find "Class1".
B: When i use something like this:
#include "Class1.h"
template <> Class1<Class2>::Class1(){}
The linker is able to find it.
My problem is, that i need to use A in my code and not B.
That means i don't want to use:
template <> Class1<Class2>::Class1(){}
I Want to use ONLY:
template <typename T>
Class1<T>::Class1(){
//Some code
}
All tutorials say that i use it correctly and it has to work. Can anybody help me?