
17 Dec
2012
17 Dec
'12
3:50 p.m.
Dear all, we use here the multi_array as a 2 dimensional matrix. Often we want to resize the row or column dependent on some GUI event. Code could be: void Bla::ResizeRows(size_t nRows) { m_matrix.resize(boost::extents[nRows][m_matrix[0].size()]); } However this uses the 0-index of row count (i.e. 'm_matrix[0].size()') to determine the size of the columns. Will this not crash if you have 0 rows? And if so is there a better alternative? wkr.