[ox/std] Fix Vector reverse iterators
This commit is contained in:
parent
4a4f380a11
commit
e2b9823ae2
10
deps/ox/src/ox/std/vector.hpp
vendored
10
deps/ox/src/ox/std/vector.hpp
vendored
@ -110,7 +110,7 @@ class Vector: detail::SmallVector<T, SmallVectorSize> {
|
|||||||
size_type m_max = 0;
|
size_type m_max = 0;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
constexpr iterator(PtrType t, size_type offset, size_type max) {
|
constexpr iterator(PtrType t, size_type offset, size_type max) noexcept {
|
||||||
m_t = t;
|
m_t = t;
|
||||||
m_offset = offset;
|
m_offset = offset;
|
||||||
m_max = max;
|
m_max = max;
|
||||||
@ -240,19 +240,19 @@ class Vector: detail::SmallVector<T, SmallVectorSize> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
constexpr iterator<T&, T*, true> rbegin() const noexcept {
|
constexpr iterator<T&, T*, true> rbegin() const noexcept {
|
||||||
return iterator<T&, T*, true>(m_items, m_size, m_size);
|
return iterator<T&, T*, true>(m_items, m_size - 1, m_size);
|
||||||
}
|
}
|
||||||
|
|
||||||
constexpr iterator<T&, T*, true> rend() const noexcept {
|
constexpr iterator<T&, T*, true> rend() const noexcept {
|
||||||
return iterator<T&, T*, true>(m_items, 0, m_size);
|
return iterator<T&, T*, true>(m_items, MaxValue<size_type>, m_size);
|
||||||
}
|
}
|
||||||
|
|
||||||
constexpr iterator<const T&, const T*, true> crbegin() const noexcept {
|
constexpr iterator<const T&, const T*, true> crbegin() const noexcept {
|
||||||
return iterator<const T&, const T*, true>(m_items, m_size, m_size);
|
return iterator<const T&, const T*, true>(m_items, m_size - 1, m_size);
|
||||||
}
|
}
|
||||||
|
|
||||||
constexpr iterator<const T&, const T*, true> crend() const noexcept {
|
constexpr iterator<const T&, const T*, true> crend() const noexcept {
|
||||||
return iterator<const T&, const T*, true>(m_items, 0, m_size);
|
return iterator<const T&, const T*, true>(m_items, MaxValue<size_type>, m_size);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool operator==(const Vector &other) const;
|
bool operator==(const Vector &other) const;
|
||||||
|
Loading…
Reference in New Issue
Block a user