Boost.MultiArray bounds checking

I'm using boost 1.32, and boost::multi_array doesn't seem to provide any bounds-checked access. I'm curious if there are any plans to add a bounds-checked at() member function to complement the [] operator? Or, is there some reason it is impractical? -- Frank

Hi Frank, There are no plans to add an at() member function. However, I have considered adding bounds checking to MultiArray operator[] as a debug mode option. ron On Feb 2, 2006, at 9:58 AM, Frank Hess wrote:
I'm using boost 1.32, and boost::multi_array doesn't seem to provide any bounds-checked access. I'm curious if there are any plans to add a bounds-checked at() member function to complement the [] operator? Or, is there some reason it is impractical?
-- Frank _______________________________________________ Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users

Ronald Garcia wrote:
Hi Frank,
There are no plans to add an at() member function. However, I have considered adding bounds checking to MultiArray operator[] as a debug mode option.
What consideration are you making? Some lone time ago I added that boost::array. Can it hurt to add it? -Thorsten

Hi Thorsten, Honestly, I was just considering whether it would be worth while to take the time to do so. Given the amount of interest shown here, I have gone ahead and added range checking to the value accessor operator[]() and the element accessor operator()(). The range checks are based on boost/assert.hpp: they can be disabled by either defining BOOST_DISABLE_ASSERTS or NDEBUG. I have yet to update the documentation to reflect this, but I thought it wise to announce the feature addition. Cheers, ron On Feb 2, 2006, at 2:15 PM, Thorsten Ottosen wrote:
Ronald Garcia wrote:
There are no plans to add an at() member function. However, I have considered adding bounds checking to MultiArray operator[] as a debug mode option.
What consideration are you making? Some lone time ago I added that boost::array. Can it hurt to add it?
participants (3)
-
Frank Hess
-
Ronald Garcia
-
Thorsten Ottosen