Boost logo

Boost Users :

From: Kresimir Fresl (fresl_at_[hidden])
Date: 2003-04-07 11:43:13


Hi Joerg, hi Stephan,

>>question is the following: Is it intentional, that it
>>is not possible to compile:
>>
>>#include <boost/numeric/ublas/matrix.hpp>
>>#include <boost/numeric/ublas/io.hpp>
>>
>>int main () {
>> using namespace boost::numeric::ublas;
>> matrix<double> m (4, 4);
>> for (unsigned int i = 0; i < m.size1 (); ++ i)
>> for (unsigned int j = 0; j < m.size2 (); ++ j)
>> m(i, j) = 4*i+j;
>>
>> std::cout << m << std::endl;
>>
>> swap(row(m,0), row(m,2));
>>
>> std::cout << m << std::endl;
>>}

> No. This one compiles with ICC 7.0 and fails with GCC 3.2.1.

It also fails with como. As it should.

This is the old problem of binding references to temporaries:
parameters of `swap()' are *non-const* references, and they
cannot be bound to temporaries returned by `row()'.

It seems that `project()' raises its ugly head again :o(

fres


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