I just don't get it and can't find any other tutorial besides the official one.
Could anyone demonstrate how I would use std::fill to set all items to 42.
Code:#include "boost/multi_array.hpp" #include <iostream> #include <algorithm> #include <iterator> int main () { typedef boost::multi_array<int, 2> Array2d; Array2d A(boost::extents[3][4]); //... ??? //std::fill ( ???, ???, 42 ); //output for (unsigned i = 0; i != A.size(); ++i) { std::copy(A[i].begin(), A[i].end(), std::ostream_iterator<int>(std::cout, " ")); std::cout << '\n'; } }



LinkBack URL
About LinkBacks



CornedBee