|
Ublas : |
From: Gunter Winkler (guwi17_at_[hidden])
Date: 2007-05-01 15:41:49
Gross, Steve schrieb:
> That's not bad, but it does require that my code be in header files, rather than .cpp's. Is there a non-templated way to make this work?
>
Is it really a problem to add a short algorithm into the header?
However, if you are going to release a library you don't have to give
this header away if you explicitly instanciate all needed versions:
(untested - if I remember correctly.)
(private) header.hpp
template < class T >
void foo(const T& t)
{ // impl. }
instances.cpp
...
foo<double>();
foo<int>();
...
mfg
Gunter