Closed tpadioleau closed 3 years ago
Yeah
Actually I think this should be covered by the converting constructor. https://github.com/kokkos/mdspan/blob/606026cb3ff17accb227ab115b2232d40eb470f1/include/experimental/__p0009_bits/basic_mdspan.hpp#L182-L195
It looks like the issue comes from the accessor not being convertible https://github.com/kokkos/mdspan/blob/606026cb3ff17accb227ab115b2232d40eb470f1/include/experimental/__p0009_bits/basic_mdspan.hpp#L186
actually if the problem is just the accessor then the above doesn't help, since is_convertible for the accessor types doesn't come back true.
The snippet below does not seem to compile
The compilation error seems to come from the
accessor_basic
that is not convertible fromaccessor_basic<double>
toaccessor_basic<double const>
.I think one might expect to be able to assign a
mdspan
to amdspan
toconst
as it is the case forstd::span
.A fix could be to add a conversion operator like this one