Re: [multi] Formal Review Begins

Ruben Perez via Boost <[email protected]>
Newsgroups gmane.comp.lib.boost.devel
Message-ID <CACR-mdK+5Xugmz2wZZPHPfmW+KRAD7VX4JqyxRz4-MCQfLvN6g@mail.gmail.com>
On Thu, 12 Mar 2026 at 20:04, Rainer Deyke via Boost <[email protected]>
wrote:

> On 3/12/26 17:02, Ruben Perez via Boost wrote:
> > * Subarrays and array references are not copyable. This is unusual,
> > since all reference
> >    types I know of (span, mdspan, string_view, url_view,
> > mysql::rows_view) are copyable.
> >    It looks like the library tries to make the type appear like a
> reference, but
> >    I don't think that's wise - exotic references are not language
> references,
> >    no matter how hard you try.
> >    I would make subarrays copyable to avoid surprises.
>
> I would agree, except that this would actually break some major uses of
> subarrays.  For example:
>
>    multi::array<int, 2> a({5, 5}), b({5, 5});
>    a({0, 2}, {0, 2}) = b({0, 2}, {0, 2});
>
> This copies a 2×2 square from one array to another array.  a's
> operator() returns a subarray.  b's operator() returns another subarray.
>   The first subarray's operator= copies the data from b to a.  This can
> only work if subarray::operator= copies the actual data instead of
> changing the array the subarray refers to.


Fair. I stand corrected.
_______________________________________________
Boost mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://lists.boost.org/mailman3/lists/boost.lists.boost.org/
Archived at: https://lists.boost.org/archives/list/[email protected]/message/E3IB34NW6WXCHESTY6T7YWORKS2KYE6Q/
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.