23 Containers library [containers]

23.7 Views [views]

23.7.3 Multidimensional access [views.multidim]

23.7.3.8 Multidimensional copy algorithms [mdspan.copy]

template<class Src, class Dst> constexpr void copy(const Src& src, const Dst& dst); template<class ExecutionPolicy, class Src, class Dst> void copy(ExecutionPolicy&& policy, const Src& src, const Dst& dst);
Constraints:
  • Src and Dst are specializations of mdspan,
  • is_assignable_v<typename Dst​::​reference, typename Src​::​reference> is true, and
  • is_constructible_v<typename Src​::​extents_type, typename Dst​::​extents_type> is true.
[Note 1: 
This constraint effectively verifies that the ranks of the extents are the same and that each extent is either static and the same, or dynamic_extent.
— end note]
Preconditions:
  • dst.is_unique() is true, and
  • for each multidimensional index i in src.extents(), there is no multidimensional index j in dst.extents() such that src[i] and dst[j] refer to the same element.
Hardened preconditions: src.extents() equals dst.extents().
Effects: Assigns each element of src to the corresponding element of dst.
template<class Dst, class T = Dst::value_type> constexpr void fill(const Dst& dst, const T& value); template<class ExecutionPolicy, class Dst, class T = Dst::value_type> void fill(ExecutionPolicy&& policy, const Dst& dst, const T& value);
Constraints:
  • Dst is a specializations of mdspan, and
  • is_assignable_v<typename Dst​::​reference, const T&> is true.
Effects: Assigns value to each element of dst.