Hi Joerg, thank you. I think I am starting to learn (steep slope ;-).
I'd tend to use
template<class E> void foo (vector_expression<E> &arg);
or
template<class E> void foo (const vector_expression<E> &arg);
Can I see this as specifying the base classes of my argument types?
Should I use iterators for whattype?
Unsure about that.
I tried to do it, but there seem to be some problems with VC60 (distance_type instead of difference_type, iterator_traits don't work because of unsopported partial specialization, ...)
(Which container should I use in this case?)
No need to copy yet.
Ok, these arguments are expressions. But now I ran into the following:
=============================================================
template<class E>
struct func {
func(const matrix_expression<E>& arg) : e(arg) {}
typename E::value_type operator() ()
{ return e[e.size1()-1]; };
private:
//const matrix_expression<E>& e; // error-> size1 not a member
of matrix_expression
const matrix_reference<E> e; // doesn't work either...
};
int main(int argc, char* argv[])
{
matrix<double> v (3,3);
func