On Fri, Aug 14, 2009 at 11:39 AM, HweeKuan Lee
<hweekuan@yahoo.com> wrote:
i'm new to boost, but use the standard template library a lot. I have
problems with the following code.
line 12: according to the reference, i should be able to do this, but cannot compile. compile error is very long, tell me if I should include them here.
my compiler: gcc version 4.0.1 (Apple Inc. build 5490)
thanks in advance for your help.
1 #include <boost/multi_array.hpp>
2
3 int main ( ) {
4
5 typedef boost::multi_array<double,2> matrix_type;
6 typedef matrix_type::iterator iterator;
7
8 matrix_type mat(boost::extents[2][3]);
9 double v = .2;
10
11 for(iterator it=mat.begin();it!=mat.end();++it) {
12 (*it) = v; // compile error
13 }
14 }