From Jason Turner

[mdspan.layout.left.overview]

Diff to HTML by rtfpessoa

Files changed (1) hide show
  1. tmp/tmpnodrw99c/{from.md → to.md} +18 -3
tmp/tmpnodrw99c/{from.md → to.md} RENAMED
@@ -7,13 +7,13 @@ stride 1, and strides increase left-to-right as the product of extents.
7
  namespace std {
8
  template<class Extents>
9
  class layout_left::mapping {
10
  public:
11
  using extents_type = Extents;
12
- using index_type = typename extents_type::index_type;
13
- using size_type = typename extents_type::size_type;
14
- using rank_type = typename extents_type::rank_type;
15
  using layout_type = layout_left;
16
 
17
  // [mdspan.layout.left.cons], constructors
18
  constexpr mapping() noexcept = default;
19
  constexpr mapping(const mapping&) noexcept = default;
@@ -22,10 +22,14 @@ namespace std {
22
  constexpr explicit(!is_convertible_v<OtherExtents, extents_type>)
23
  mapping(const mapping<OtherExtents>&) noexcept;
24
  template<class OtherExtents>
25
  constexpr explicit(!is_convertible_v<OtherExtents, extents_type>)
26
  mapping(const layout_right::mapping<OtherExtents>&) noexcept;
 
 
 
 
27
  template<class OtherExtents>
28
  constexpr explicit(extents_type::rank() > 0)
29
  mapping(const layout_stride::mapping<OtherExtents>&);
30
 
31
  constexpr mapping& operator=(const mapping&) noexcept = default;
@@ -51,10 +55,21 @@ namespace std {
51
  template<class OtherExtents>
52
  friend constexpr bool operator==(const mapping&, const mapping<OtherExtents>&) noexcept;
53
 
54
  private:
55
  extents_type extents_{}; // exposition only
 
 
 
 
 
 
 
 
 
 
 
56
  };
57
  }
58
  ```
59
 
60
  If `Extents` is not a specialization of `extents`, then the program is
 
7
  namespace std {
8
  template<class Extents>
9
  class layout_left::mapping {
10
  public:
11
  using extents_type = Extents;
12
+ using index_type = extents_type::index_type;
13
+ using size_type = extents_type::size_type;
14
+ using rank_type = extents_type::rank_type;
15
  using layout_type = layout_left;
16
 
17
  // [mdspan.layout.left.cons], constructors
18
  constexpr mapping() noexcept = default;
19
  constexpr mapping(const mapping&) noexcept = default;
 
22
  constexpr explicit(!is_convertible_v<OtherExtents, extents_type>)
23
  mapping(const mapping<OtherExtents>&) noexcept;
24
  template<class OtherExtents>
25
  constexpr explicit(!is_convertible_v<OtherExtents, extents_type>)
26
  mapping(const layout_right::mapping<OtherExtents>&) noexcept;
27
+ template<class LayoutLeftPaddedMapping>
28
+ constexpr explicit(!is_convertible_v<typename LayoutLeftPaddedMapping::extents_type,
29
+ extents_type>)
30
+ mapping(const LayoutLeftPaddedMapping&) noexcept;
31
  template<class OtherExtents>
32
  constexpr explicit(extents_type::rank() > 0)
33
  mapping(const layout_stride::mapping<OtherExtents>&);
34
 
35
  constexpr mapping& operator=(const mapping&) noexcept = default;
 
55
  template<class OtherExtents>
56
  friend constexpr bool operator==(const mapping&, const mapping<OtherExtents>&) noexcept;
57
 
58
  private:
59
  extents_type extents_{}; // exposition only
60
+
61
+ // [mdspan.sub.map], submdspan mapping specialization
62
+ template<class... SliceSpecifiers>
63
+ constexpr auto submdspan-mapping-impl(SliceSpecifiers...) const // exposition only
64
+ -> see below;
65
+
66
+ template<class... SliceSpecifiers>
67
+ friend constexpr auto submdspan_mapping(
68
+ const mapping& src, SliceSpecifiers... slices) {
69
+ return src.submdspan-mapping-impl(slices...);
70
+ }
71
  };
72
  }
73
  ```
74
 
75
  If `Extents` is not a specialization of `extents`, then the program is