Boost logo

Ublas :

From: Gross, Steve (SGross_at_[hidden])
Date: 2007-05-02 12:28:42


(1) That's a pretty cool trick (pre-instantiating the function).

(2) Yeah, it still is annoying to have to do this. I really want to be
able to pass around vector_range's without having to know what the
underlying type is (matrix row or column, that is).

--Steve

------------------------------

Message: 3
Date: Tue, 01 May 2007 21:41:49 +0200
From: Gunter Winkler <guwi17_at_[hidden]>
Subject: Re: [ublas] ublas Digest, Vol 30, Issue 1
To: ublas mailing list <ublas_at_[hidden]>
Message-ID: <463797FD.5060100_at_[hidden]>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed

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