tmp/tmpckopodq1/{from.md → to.md}
RENAMED
|
@@ -37,16 +37,15 @@ namespace std {
|
|
| 37 |
constexpr span(array<T, N>& arr) noexcept;
|
| 38 |
template<class T, size_t N>
|
| 39 |
constexpr span(const array<T, N>& arr) noexcept;
|
| 40 |
template<class R>
|
| 41 |
constexpr explicit(extent != dynamic_extent) span(R&& r);
|
|
|
|
| 42 |
constexpr span(const span& other) noexcept = default;
|
| 43 |
template<class OtherElementType, size_t OtherExtent>
|
| 44 |
constexpr explicit(see below) span(const span<OtherElementType, OtherExtent>& s) noexcept;
|
| 45 |
|
| 46 |
-
~span() noexcept = default;
|
| 47 |
-
|
| 48 |
constexpr span& operator=(const span& other) noexcept = default;
|
| 49 |
|
| 50 |
// [span.sub], subviews
|
| 51 |
template<size_t Count>
|
| 52 |
constexpr span<element_type, Count> first() const;
|
|
@@ -61,14 +60,15 @@ namespace std {
|
|
| 61 |
size_type offset, size_type count = dynamic_extent) const;
|
| 62 |
|
| 63 |
// [span.obs], observers
|
| 64 |
constexpr size_type size() const noexcept;
|
| 65 |
constexpr size_type size_bytes() const noexcept;
|
| 66 |
-
|
| 67 |
|
| 68 |
// [span.elem], element access
|
| 69 |
constexpr reference operator[](size_type idx) const;
|
|
|
|
| 70 |
constexpr reference front() const;
|
| 71 |
constexpr reference back() const;
|
| 72 |
constexpr pointer data() const noexcept;
|
| 73 |
|
| 74 |
// [span.iterators], iterator support
|
|
@@ -85,11 +85,12 @@ namespace std {
|
|
| 85 |
pointer data_; // exposition only
|
| 86 |
size_type size_; // exposition only
|
| 87 |
};
|
| 88 |
|
| 89 |
template<class It, class EndOrSize>
|
| 90 |
-
span(It, EndOrSize) -> span<remove_reference_t<iter_reference_t<It>>
|
|
|
|
| 91 |
template<class T, size_t N>
|
| 92 |
span(T (&)[N]) -> span<T, N>;
|
| 93 |
template<class T, size_t N>
|
| 94 |
span(array<T, N>&) -> span<T, N>;
|
| 95 |
template<class T, size_t N>
|
|
@@ -103,5 +104,9 @@ namespace std {
|
|
| 103 |
[[term.trivially.copyable.type]].
|
| 104 |
|
| 105 |
`ElementType` is required to be a complete object type that is not an
|
| 106 |
abstract class type.
|
| 107 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 37 |
constexpr span(array<T, N>& arr) noexcept;
|
| 38 |
template<class T, size_t N>
|
| 39 |
constexpr span(const array<T, N>& arr) noexcept;
|
| 40 |
template<class R>
|
| 41 |
constexpr explicit(extent != dynamic_extent) span(R&& r);
|
| 42 |
+
constexpr explicit(extent != dynamic_extent) span(std::initializer_list<value_type> il);
|
| 43 |
constexpr span(const span& other) noexcept = default;
|
| 44 |
template<class OtherElementType, size_t OtherExtent>
|
| 45 |
constexpr explicit(see below) span(const span<OtherElementType, OtherExtent>& s) noexcept;
|
| 46 |
|
|
|
|
|
|
|
| 47 |
constexpr span& operator=(const span& other) noexcept = default;
|
| 48 |
|
| 49 |
// [span.sub], subviews
|
| 50 |
template<size_t Count>
|
| 51 |
constexpr span<element_type, Count> first() const;
|
|
|
|
| 60 |
size_type offset, size_type count = dynamic_extent) const;
|
| 61 |
|
| 62 |
// [span.obs], observers
|
| 63 |
constexpr size_type size() const noexcept;
|
| 64 |
constexpr size_type size_bytes() const noexcept;
|
| 65 |
+
constexpr bool empty() const noexcept;
|
| 66 |
|
| 67 |
// [span.elem], element access
|
| 68 |
constexpr reference operator[](size_type idx) const;
|
| 69 |
+
constexpr reference at(size_type idx) const; // freestanding-deleted
|
| 70 |
constexpr reference front() const;
|
| 71 |
constexpr reference back() const;
|
| 72 |
constexpr pointer data() const noexcept;
|
| 73 |
|
| 74 |
// [span.iterators], iterator support
|
|
|
|
| 85 |
pointer data_; // exposition only
|
| 86 |
size_type size_; // exposition only
|
| 87 |
};
|
| 88 |
|
| 89 |
template<class It, class EndOrSize>
|
| 90 |
+
span(It, EndOrSize) -> span<remove_reference_t<iter_reference_t<It>>,
|
| 91 |
+
maybe-static-ext<EndOrSize>>;
|
| 92 |
template<class T, size_t N>
|
| 93 |
span(T (&)[N]) -> span<T, N>;
|
| 94 |
template<class T, size_t N>
|
| 95 |
span(array<T, N>&) -> span<T, N>;
|
| 96 |
template<class T, size_t N>
|
|
|
|
| 104 |
[[term.trivially.copyable.type]].
|
| 105 |
|
| 106 |
`ElementType` is required to be a complete object type that is not an
|
| 107 |
abstract class type.
|
| 108 |
|
| 109 |
+
For a `span` `s`, any operation that invalidates a pointer in the range
|
| 110 |
+
\[`s.data()`, `s.data() + s.size()`) invalidates pointers, iterators,
|
| 111 |
+
and references to elements of `s`.
|
| 112 |
+
|