Const boost :: array <T, N> or boost :: array <const T, N>?
3 answers
The second method will allow you to copy it to a new non-constant array
boost::array<const int, 2> y = {0, 1};
boost::array<int, 2> y1 = y; // error!
Since I would expect that to work, I will probably go with the first option. Passing a second template, expecting that boost::array<T, N>it will not allow these templates to change their parameter (even if it is a copy). The first will be βjust working,β since the parameter will be of type boost::array<int, 2>.
+6