tmp/tmpon2tekcr/{from.md → to.md}
RENAMED
|
@@ -0,0 +1,69 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
###### Overview <a id="mdspan.layout.right.overview">[[mdspan.layout.right.overview]]</a>
|
| 2 |
+
|
| 3 |
+
`layout_right` provides a layout mapping where the rightmost extent is
|
| 4 |
+
stride 1, and strides increase right-to-left as the product of extents.
|
| 5 |
+
|
| 6 |
+
``` cpp
|
| 7 |
+
namespace std {
|
| 8 |
+
template<class Extents>
|
| 9 |
+
class layout_right::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_right;
|
| 16 |
+
|
| 17 |
+
// [mdspan.layout.right.cons], constructors
|
| 18 |
+
constexpr mapping() noexcept = default;
|
| 19 |
+
constexpr mapping(const mapping&) noexcept = default;
|
| 20 |
+
constexpr mapping(const extents_type&) noexcept;
|
| 21 |
+
template<class OtherExtents>
|
| 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_left::mapping<OtherExtents>&) noexcept;
|
| 27 |
+
template<class OtherExtents>
|
| 28 |
+
constexpr explicit(extents_type::rank() > 0)
|
| 29 |
+
mapping(const layout_stride::mapping<OtherExtents>&) noexcept;
|
| 30 |
+
|
| 31 |
+
constexpr mapping& operator=(const mapping&) noexcept = default;
|
| 32 |
+
|
| 33 |
+
// [mdspan.layout.right.obs], observers
|
| 34 |
+
constexpr const extents_type& extents() const noexcept { return extents_; }
|
| 35 |
+
|
| 36 |
+
constexpr index_type required_span_size() const noexcept;
|
| 37 |
+
|
| 38 |
+
template<class... Indices>
|
| 39 |
+
constexpr index_type operator()(Indices...) const noexcept;
|
| 40 |
+
|
| 41 |
+
static constexpr bool is_always_unique() noexcept { return true; }
|
| 42 |
+
static constexpr bool is_always_exhaustive() noexcept { return true; }
|
| 43 |
+
static constexpr bool is_always_strided() noexcept { return true; }
|
| 44 |
+
|
| 45 |
+
static constexpr bool is_unique() noexcept { return true; }
|
| 46 |
+
static constexpr bool is_exhaustive() noexcept { return true; }
|
| 47 |
+
static constexpr bool is_strided() noexcept { return true; }
|
| 48 |
+
|
| 49 |
+
constexpr index_type stride(rank_type) const noexcept;
|
| 50 |
+
|
| 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
|
| 61 |
+
ill-formed.
|
| 62 |
+
|
| 63 |
+
`layout_right::mapping<E>` is a trivially copyable type that models
|
| 64 |
+
`regular` for each `E`.
|
| 65 |
+
|
| 66 |
+
*Mandates:* If `Extents::rank_dynamic() == 0` is `true`, then the size
|
| 67 |
+
of the multidimensional index space `Extents()` is representable as a
|
| 68 |
+
value of type `typename Extents::index_type`.
|
| 69 |
+
|