[ox/std] Add SpanView::data()

(synced from 7e19f45c69)
This commit is contained in:
2023-12-05 22:51:18 -06:00
parent a820846336
commit ffc25b943f
+6 -1
View File
@@ -25,7 +25,7 @@ class SpanView {
using value_type = T;
using size_type = std::size_t;
template<typename RefType = T&, typename PtrType = T*, bool reverse = false>
template<typename RefType = T const&, typename PtrType = T const*, bool reverse = false>
using iterator = SpanIterator<T, RefType, PtrType, reverse>;
template<std::size_t sz>
@@ -103,6 +103,11 @@ class SpanView {
return m_items[i];
}
[[nodiscard]]
constexpr T const*data() const noexcept {
return m_items;
}
[[nodiscard]]
constexpr std::size_t size() const noexcept {
return m_size;