Boost logo

Boost Users :

From: speedsnaii speedsnaii_at_[hidden])
Date: 2003-02-25 11:41:41


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<matrix<double> > f(v);
    
    f();

    return 0;
}
=============================================================

I think I do not yet understand of how to use the matrix_reference,
do I?

Using matrix_const_reference instead gives me an error that I have no
glue what is going on:
error C2143: syntax error : missing ';' before '<'

regards,
roland


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net