Opened 13 years ago

#3222 new Bugs

const-correctness and documentation bugs

Reported by: fhess Owned by: Ronald Garcia
Milestone: Boost 1.40.0 Component: multi_array
Version: Boost 1.39.0 Severity: Problem
Keywords: Cc:

Description

I am able to modify a const multi_array through a multi_array_ref. For example:

const boost::multi_array<int, 2> myarray(boost::extents[2][2]); boost::multi_array_ref<int, 2> myarrayref(myarray); myarrayref[0][1] = 2;

IMO, trying to create a multi_array_ref from a const multi_array should fail to compile, only a const_multi_array_ref should work. Also, the reference doesn't include the public inheritance between multi_array, multi_array_ref, and const_multi_array in their class synopses. It is important because it seems to be the only reason you can do conversions from multi_array to multi_array_ref or const_multi_array_ref.

Change History (0)

Note: See TracTickets for help on using tickets.