Boost logo

Ublas :

From: Michael Stevens (mail_at_[hidden])
Date: 2005-07-06 03:36:38


On Monday 04 July 2005 15:58, Gunter Winkler wrote:
> Hallo,
>
> there is a problem with const correctness.
>
> matrix<double> A(10,10);
>
> // this works: a mutable matrix row is returned
> cout << A[1] ;
>
> // this fails: a matrix_row<const matrix<double> > should be
> // returned but is not found by the compiler
> cout << ( (const matrix<double> &) A)[1] ;
>
> the fix is to modify matrix_expression::operator[](index) const this way:
>
> matrix_row<const E> operator[] ( size_t index ) const {
> return matrix_row<const E>( (*this), index );
> }

Ooops. That was my fault with a recent version. Should all be fixed now.

Michael