Thanx for the reply Yung-Chin.
It compiles ok, what i get is a run time error. In a single main file, it works fine too. But i had trouble when declaring the multi_array in the header file, initializing it on the construtor and then trying to assign first position to a one dimension array in one method.
It is something like this:
> //at class constructor
> boost::multi_array<char, 2> array2d = new boost::multi_array<char,
> 2>(boost::extents[x][y]);
> //at class methodI tried out those two lines (minus the "new") here (see below), and
> boost::multi_array<char, 1> array1d = array2d[0];
they compile without complaints in g++ 4.1.2.
Yung-Chin
-- contents of test file --
#include <iostream>
#include <boost/multi_array.hpp>
int main() {
size_t x = 5;
size_t y = 7;
boost::multi_array<char, 2> array2d =
boost::multi_array<char, 2>(boost::extents[x][y]);std::cout << array2d.num_dimensions() << std::endl;
std::cout << array2d[0].num_dimensions() << std::endl;
std::cout << array1d.num_dimensions() << std::endl;
boost::multi_array<char, 1> array1d = array2d[0];
return 0;
} //main
_______________________________________________
Boost-users mailing list
Boost-users@lists.boost.org
http://lists.boost.org/mailman/listinfo.cgi/boost-users