mdspan
mdspan copied to clipboard
[feature-request] CTAD for `mdspan` from `mdarray`
it would be groovy if i could create an mdspan from an mdarray like mdspan{array}. something like this might work:
//! \brief Deduction guide for \c ::std::mdspan that makes its template parameters
//! deducable from a \c ::std::experimental::mdarray.
template <class ElementType, class Extents, class LayoutPolicy, class Container>
mdspan(experimental::mdarray<ElementType, Extents, LayoutPolicy, Container>&)
-> mdspan<ElementType, Extents, LayoutPolicy>;
//! \overload
template <class ElementType, class Extents, class LayoutPolicy, class Container>
mdspan(const experimental::mdarray<ElementType, Extents, LayoutPolicy, Container>&)
-> mdspan<const ElementType, Extents, LayoutPolicy>;
Yeah definitely on the todo list. We got stuck with mdarray for a bit but I do want to revive it because I think it's just a huge usability improvement.
@crtrott I'd love to redo the paper completely, making the static-allocation + all-static-extents case a container like std::array, and replacing the dynamic-allocation case with unique_mdarray.