Boost logo

Boost Users :

From: speedsnaii speedsnaii_at_[hidden])
Date: 2003-02-07 12:06:45


Since I did not get an answer on a related question, I am trying to
state it different.

It seems as if the "[]" access is not supported for const objects. Is
there a reason for this, or is it a bug?

Example:
==========================================================
#include <boost/numeric/ublas/config.hpp>
#include <boost/numeric/ublas/vector.hpp>
#include <boost/numeric/ublas/matrix.hpp>
using namespace boost::numeric::ublas;

void foo(vector<double>& v, const vector<double>& a)
{
}

int main(int argc, char* argv[])
{
vector<double> v (3);
const matrix<double> m(3,3);

    foo(v, m[0]);
}
==========================================================
my compiler does not compile this.
This is a problem when I get the matrix as a "const matrix<>& "
parameter via the argument list.

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