c++: boost::multi_array - initialize a multi_array

Hi all,
i am trying to initialize all the elements in boost::multi_array type to
zero, so far, with out success. At tried using std::fill for 1-dim
boost::multi_array and it worked. Once i tried std:fill on 2-dim
boost::multi_array it haven't worked any more.
I saw boost have
#include
std::fill( foo.begin() , foo.end() , 0); std::fill( boo.begin()->begin() , boo.end()->end() , 0); std::cout << "Done" << std::endl; return EXIT_SUCCESS; } any suggestion is welcome regards

One approach is the use multi_array::data() and
multi_array::num_elements() to get pointer-based iterators to the
underlying raw storage:
boost::multi_array
participants (2)
-
Hannan Sadar
-
Rhys Ulerich