I would like to know how to read elements from a const boost::multi_array object.
Indeed to my knowledge I can’t use the operator [] because it’s also used to assignement.
I have a 3-D dimentional array. So how does one get the element myArray[i][j][k] when myArray is const.
As an alternative to juanchopanza’s answer you can also access elements via an index array build from a boost::array.
Would give you the element
myArray[1][2][3]. In case you are writing dimension-independent code this notation might be more useful than explicitly using the [] operator.