From Jason Turner

[mdspan.mdspan.overview]

Diff to HTML by rtfpessoa

Files changed (1) hide show
  1. tmp/tmpzc4pjsnk/{from.md → to.md} +18 -8
tmp/tmpzc4pjsnk/{from.md → to.md} RENAMED
@@ -9,18 +9,18 @@ namespace std {
9
  class mdspan {
10
  public:
11
  using extents_type = Extents;
12
  using layout_type = LayoutPolicy;
13
  using accessor_type = AccessorPolicy;
14
- using mapping_type = typename layout_type::template mapping<extents_type>;
15
  using element_type = ElementType;
16
  using value_type = remove_cv_t<element_type>;
17
- using index_type = typename extents_type::index_type;
18
- using size_type = typename extents_type::size_type;
19
- using rank_type = typename extents_type::rank_type;
20
- using data_handle_type = typename accessor_type::data_handle_type;
21
- using reference = typename accessor_type::reference;
22
 
23
  static constexpr rank_type rank() noexcept { return extents_type::rank(); }
24
  static constexpr rank_type rank_dynamic() noexcept { return extents_type::rank_dynamic(); }
25
  static constexpr size_t static_extent(rank_type r) noexcept
26
  { return extents_type::static_extent(r); }
@@ -58,12 +58,22 @@ namespace std {
58
  template<class OtherIndexType>
59
  constexpr reference operator[](span<OtherIndexType, rank()> indices) const;
60
  template<class OtherIndexType>
61
  constexpr reference operator[](const array<OtherIndexType, rank()>& indices) const;
62
 
 
 
 
 
 
 
 
 
 
 
63
  constexpr size_type size() const noexcept;
64
- [[nodiscard]] constexpr bool empty() const noexcept;
65
 
66
  friend constexpr void swap(mdspan& x, mdspan& y) noexcept;
67
 
68
  constexpr const extents_type& extents() const noexcept { return map_.extents(); }
69
  constexpr const data_handle_type& data_handle() const noexcept { return ptr_; }
@@ -103,11 +113,11 @@ namespace std {
103
  -> mdspan<remove_pointer_t<remove_reference_t<Pointer>>, extents<size_t>>;
104
 
105
  template<class ElementType, class... Integrals>
106
  requires ((is_convertible_v<Integrals, size_t> && ...) && sizeof...(Integrals) > 0)
107
  explicit mdspan(ElementType*, Integrals...)
108
- -> mdspan<ElementType, dextents<size_t, sizeof...(Integrals)>>;
109
 
110
  template<class ElementType, class OtherIndexType, size_t N>
111
  mdspan(ElementType*, span<OtherIndexType, N>)
112
  -> mdspan<ElementType, dextents<size_t, N>>;
113
 
 
9
  class mdspan {
10
  public:
11
  using extents_type = Extents;
12
  using layout_type = LayoutPolicy;
13
  using accessor_type = AccessorPolicy;
14
+ using mapping_type = layout_type::template mapping<extents_type>;
15
  using element_type = ElementType;
16
  using value_type = remove_cv_t<element_type>;
17
+ using index_type = extents_type::index_type;
18
+ using size_type = extents_type::size_type;
19
+ using rank_type = extents_type::rank_type;
20
+ using data_handle_type = accessor_type::data_handle_type;
21
+ using reference = accessor_type::reference;
22
 
23
  static constexpr rank_type rank() noexcept { return extents_type::rank(); }
24
  static constexpr rank_type rank_dynamic() noexcept { return extents_type::rank_dynamic(); }
25
  static constexpr size_t static_extent(rank_type r) noexcept
26
  { return extents_type::static_extent(r); }
 
58
  template<class OtherIndexType>
59
  constexpr reference operator[](span<OtherIndexType, rank()> indices) const;
60
  template<class OtherIndexType>
61
  constexpr reference operator[](const array<OtherIndexType, rank()>& indices) const;
62
 
63
+ template<class... OtherIndexTypes>
64
+ constexpr reference
65
+ at(OtherIndexTypes... indices) const; // freestanding-deleted
66
+ template<class OtherIndexType>
67
+ constexpr reference
68
+ at(span<OtherIndexType, rank()> indices) const; // freestanding-deleted
69
+ template<class OtherIndexType>
70
+ constexpr reference
71
+ at(const array<OtherIndexType, rank()>& indices) const; // freestanding-deleted
72
+
73
  constexpr size_type size() const noexcept;
74
+ constexpr bool empty() const noexcept;
75
 
76
  friend constexpr void swap(mdspan& x, mdspan& y) noexcept;
77
 
78
  constexpr const extents_type& extents() const noexcept { return map_.extents(); }
79
  constexpr const data_handle_type& data_handle() const noexcept { return ptr_; }
 
113
  -> mdspan<remove_pointer_t<remove_reference_t<Pointer>>, extents<size_t>>;
114
 
115
  template<class ElementType, class... Integrals>
116
  requires ((is_convertible_v<Integrals, size_t> && ...) && sizeof...(Integrals) > 0)
117
  explicit mdspan(ElementType*, Integrals...)
118
+ -> mdspan<ElementType, extents<size_t, maybe-static-ext<Integrals>...>>;
119
 
120
  template<class ElementType, class OtherIndexType, size_t N>
121
  mdspan(ElementType*, span<OtherIndexType, N>)
122
  -> mdspan<ElementType, dextents<size_t, N>>;
123