Boost logo

Boost :

From: Helmut Zeisel (HZ2012_at_[hidden])
Date: 2022-01-09 05:46:34


> Von: "Ivan Matek" <libbooze_at_[hidden]>
> On Fri, Jan 7, 2022 at 8:16 AM Helmut Zeisel via Boost <boost_at_[hidden][mailto:boost_at_[hidden]]> wrote:
>> 1) boost::multi_array_ref does not own the memory (which creates at least the memory overhead of one pointer)
> AFAIK boost::multi_array (no _ref suffix) owns memory, but it still does 1 heap allocation.

Yes.

What I have in mind, however, (as I mentioned already ealier) is some general adapter class

template<typename T, typename Index, typename Policy>
struct array_index_adapter { ... };

that can apply different types of indices (row major, column major, triangular ...) to different containers (stack allocated, heap allocated, mixed like boost::small_vector etc).

Helmut


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk