[ox/std] Add missing iterator functions to String and Vector
This commit is contained in:
parent
60aa172d98
commit
4e0cd1444d
20
deps/ox/src/ox/std/string.hpp
vendored
20
deps/ox/src/ox/std/string.hpp
vendored
@ -50,6 +50,16 @@ class BasicString {
|
||||
return m_buff.end();
|
||||
}
|
||||
|
||||
[[nodiscard]]
|
||||
constexpr auto begin() const noexcept {
|
||||
return m_buff.begin();
|
||||
}
|
||||
|
||||
[[nodiscard]]
|
||||
constexpr auto end() const noexcept {
|
||||
return m_buff.end();
|
||||
}
|
||||
|
||||
[[nodiscard]]
|
||||
constexpr auto cbegin() const noexcept {
|
||||
return m_buff.begin();
|
||||
@ -70,6 +80,16 @@ class BasicString {
|
||||
return m_buff.rend();
|
||||
}
|
||||
|
||||
[[nodiscard]]
|
||||
constexpr auto rbegin() const noexcept {
|
||||
return m_buff.rbegin();
|
||||
}
|
||||
|
||||
[[nodiscard]]
|
||||
constexpr auto rend() const noexcept {
|
||||
return m_buff.rend();
|
||||
}
|
||||
|
||||
[[nodiscard]]
|
||||
constexpr auto crbegin() const noexcept {
|
||||
return m_buff.rbegin();
|
||||
|
16
deps/ox/src/ox/std/vector.hpp
vendored
16
deps/ox/src/ox/std/vector.hpp
vendored
@ -249,6 +249,14 @@ class Vector: detail::SmallVector<T, SmallVectorSize> {
|
||||
return iterator<const T&, const T*>(m_items, m_size, m_size);
|
||||
}
|
||||
|
||||
constexpr iterator<const T&, const T*> cbegin() const noexcept {
|
||||
return iterator<const T&, const T*>(m_items, 0, m_size);
|
||||
}
|
||||
|
||||
constexpr iterator<const T&, const T*> cend() const noexcept {
|
||||
return iterator<const T&, const T*>(m_items, m_size, m_size);
|
||||
}
|
||||
|
||||
constexpr iterator<T&, T*, true> rbegin() noexcept {
|
||||
return iterator<T&, T*, true>(m_items, m_size - 1, m_size);
|
||||
}
|
||||
@ -257,6 +265,14 @@ class Vector: detail::SmallVector<T, SmallVectorSize> {
|
||||
return iterator<T&, T*, true>(m_items, MaxValue<size_type>, m_size);
|
||||
}
|
||||
|
||||
constexpr iterator<const T&, const T*, true> crbegin() const noexcept {
|
||||
return iterator<const T&, const T*, true>(m_items, m_size - 1, m_size);
|
||||
}
|
||||
|
||||
constexpr iterator<const T&, const T*, true> crend() const noexcept {
|
||||
return iterator<const T&, const T*, true>(m_items, MaxValue<size_type>, m_size);
|
||||
}
|
||||
|
||||
constexpr iterator<const T&, const T*, true> rbegin() const noexcept {
|
||||
return iterator<const T&, const T*, true>(m_items, m_size - 1, m_size);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user