Hi,
I'm trying to create a template memberfunction in a non-template class,
using gcc under Linux:
plot.h:
namespace ml {
class Axes {
public:
Axes(double id);
~Axes();
template <typename TLinePlot& plot(T *x, T *y, char *options=0);
};
}
A function definition (outside the namespace ml, but still inside the header
file works, i.e.
template <typename Tml::LinePlot& ml::Axes::plot(T *x, T *y, char
*options) {
fprintf(stderr, "test\n");
}
If I move the same definition from the .h to the .cpp file I get a linking
error:
undefined reference to `ml::LinePlot&
ml::Axes::plot<gsl_vector>(gsl_vector*, gsl_vector*, char*)'
Any ideas whats going on here?
Thanks in advance
Ciao
Uwe