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

This commit is contained in:
Gary Talent 2023-12-05 22:51:18 -06:00
parent 57ba1caf90
commit 7e19f45c69

View File

@ -25,7 +25,7 @@ class SpanView {
using value_type = T; using value_type = T;
using size_type = std::size_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>; using iterator = SpanIterator<T, RefType, PtrType, reverse>;
template<std::size_t sz> template<std::size_t sz>
@ -103,6 +103,11 @@ class SpanView {
return m_items[i]; return m_items[i];
} }
[[nodiscard]]
constexpr T const*data() const noexcept {
return m_items;
}
[[nodiscard]] [[nodiscard]]
constexpr std::size_t size() const noexcept { constexpr std::size_t size() const noexcept {
return m_size; return m_size;