Hi Joerg,
OK, I think I understand now what you're aiming at: you want ublas to give you the characteristics of (ordinary ;-) runtime polymorphism. But would you be willing to pay the performance penalty for using an virtual operator() then, for example?
I think generally not.
Hmmm, but is there a way to do without? After a lot of reading and
thinking and with your help :-) I came out with the following. May I
show you a code snippet from my spline function to show you my actual
problem?
================================================================
template<class T>
class vector_proxy_base {
public:
virtual T operator[] (unsigned int idx) = 0;
};
template<class E>
class vector_proxy : public vector_proxy_base
vector_reference<> is mainly needed to describe the signatures of
operators
returning expression templates.
I was trying to template<class E> void foo(vector_reference<E> e) { e.size(); // some use of e } and call it foo(m.column(0)); But my compiler chokes. So am I right, that vector_reference is not intended for this kind of usage?
groups.yahoo.com/group/ublas-dev
Oh, I may read this as an ordinary user? Didn't try this yet. Thank you for the hint. BTW.: I've delayed the idea of COW (Copy On Write?) This was before I realized that vector_expression is kind of a reference to my data. Regards, Roland