|
From: <h.r...@gm...> - 2002-03-03 00:36:35
|
Hello,
Is it forbidden to have a prototype of a template in a header file ?
For example:
a.h
template <class T> T sqr(T x);
a.cpp
template <class T> T sqr(T x) { return x * x; }
this doesnt link.
If I put the definition
template <class T> T sqr(T x) { return x * x; }
in the header, it works.
Thanks in advance
Horst
--
--------------------------
Horst Rößner
Postf. 1802
52205 Stolberg
02402 / 6178
0171 6455636
GMX - Die Kommunikationsplattform im Internet.
http://www.gmx.net
|