Closed crtrott closed 6 years ago
- Postconditions: get_extents() == Extents() and get_strides() == array<ptrdiff_t, Extents::rank()>()
I'm pretty sure this would make get_strides()
into uninitialized memory. I think what you'd actually want is get_strides() == array<ptrdiff_t, Extents::rank()>{}
, though I'm not positive about this.
26.7.�.3.1 layout_right::mapping constructors
This should be layout_stride
(also a few other places)
- Effects: Initializes extents with move(other.extents).
Two things:
strides_
with std::move(other.strides_)
move
here so that it doesn't participate in ADL, though I'm not sure if the rest of the standard does this or not.(Also need to make the analogous changes to the copy constructor.)
constexpr mapping(Extents e, array<ptrdiff_t, Extents::rank()> s) noexcept;
Remove noexcept
here; it has a requires clause so it can't be noexcept
.
more to come...
I think this is resolved
26.7.�.3.1 layout_right::mapping constructors [mdspan.layout.right.cons]
get_extents() == Extents()
andget_strides() == array<ptrdiff_t, Extents::rank()>()
get_extents() == other.get_extents()
andget_strides() == other.get_strides()
get_extents()
returns a copy of an Extents that is equal to the copy returned byother.get_extents()
before the invocation of the move andget_strides()
returns a copy of anarray<ptrdiff_t,Extents::rank()>
that is equal to the copy returned byother.get_strides()
before the invocation of the move0,...,Extents::rank()-1
o(i)
with0 <= i < Extents::rank()
such thatstride(o(i)) >= stride(o(i-1))*get_extent(o(i-1))
for1 <= i < Extents::rank()
get_extents() == e
andget_strides() == s
.get_extents() == other.get_extents()
andget_strides() == other.get_strides()
.26.7.�.3.2 layout_right::mapping operations [mdspan.layout.right.ops]
get_extents().extent(r) * stride(r)
for allr
where0 <= r < get_extents().rank()
i...
isi0, i1, i2,..., ik
(wherek == Extents::rank() - 1
) ands = get_strides()
, returnsi0*s[1] + i1*s[2] +...+ ik*s[k]
sizeof...(Indices) == Extents::rank()
,is_convertible_v<Indices, typename Extents::index_type> && ...
TODO: should this be always unique?
0,...,Extents::rank()-1
o(i)
with0 <= i < Extents::rank()
such thatmin(stride(o(i)) == 1
andstride(o(i)) == stride(o(i-1))*get_extent(o(i-1))
with1 <= i < Extents::rank()
otherwise returns falsestrides_(r)
(get_extents() == other.get_extents()) && (get_strides() == other.get_strides())
(get_extents() != other.get_extents()) || (get_strides() != other.get_strides())