UBLAS: m[i] notation not supported on const ?

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

speedsnaii wrote:
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
#include #include 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.
Which compiler? Both g++ 3.2 and Comeau C++ 4.3.0.1 are quite happy with it. BTW, do you have the latest version of ublas, from boost CVS?
This is a problem when I get the matrix as a "const matrix<>& " parameter via the argument list.
Sincerely, fres
participants (2)
-
Kresimir Fresl
-
speedsnaii <speedsnaii@yahoo.de>