Subject: [Boost-bugs] [Boost C++ Libraries] #3224: shape() should return a RandomAccessCollection
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2009-06-26 15:53:08
#3224: shape() should return a RandomAccessCollection
------------------------------+---------------------------------------------
Reporter: fhess | Owner: garcia
Type: Feature Requests | Status: new
Milestone: Boost 1.40.0 | Component: multi_array
Version: Boost 1.39.0 | Severity: Problem
Keywords: |
------------------------------+---------------------------------------------
Has there ever been any thought to making multi_array::shape() return
something that models the Collection concept (RandomAccessCollection in
particular I suppose) rather than a raw pointer? This would allow the
return value from shape() to be passed directly to multi_array::reshape()
or multi_array::resize(), for added convenience. It would also allow a
debug assertion to be added to make sure you don't try to access beyond
the end of the array returned by shape().
From looking at the multi_array code, it looks like it would be relatively
easy to add a new function called maybe "size()" which would replace
"shape()" (which could be kept but deprecated) where
size() would return a const reference to the boost::array used internally
to store the extent_list_.
-- Ticket URL: <https://svn.boost.org/trac/boost/ticket/3224> Boost C++ Libraries <http://www.boost.org/> Boost provides free peer-reviewed portable C++ source libraries.
This archive was generated by hypermail 2.1.7 : 2017-02-16 18:50:00 UTC