Technically they don't need in the header file.
- (, sake char wchar_t). . , , .
template<typename T>
class X
{
public:
X(T const& t);
private:
T m_t;
};
#include "X.h"
template<typename T>
X<T>::X(T const& t)
:m_t(t)
{}
template class X<char>;
template class X<wchar_t>;
#include "X.h"
int main()
{
X<chat> x1('a');
X<wchar_t> x2(L'A');
}
, X.cpp( ), X <int> X <float> .. abovr .
, . X, ( , ). , X, .