[ox/std] Add Vector::reserveResize
All checks were successful
Build / build (push) Successful in 1m15s
All checks were successful
Build / build (push) Successful in 1m15s
This commit is contained in:
8
deps/ox/src/ox/std/vector.hpp
vendored
8
deps/ox/src/ox/std/vector.hpp
vendored
@@ -247,6 +247,8 @@ class Vector: detail::VectorAllocator<T, Allocator, SmallVectorSize> {
|
|||||||
|
|
||||||
constexpr void resize(std::size_t size) noexcept(useNoexcept);
|
constexpr void resize(std::size_t size) noexcept(useNoexcept);
|
||||||
|
|
||||||
|
constexpr void reserveResize(std::size_t size) noexcept(useNoexcept);
|
||||||
|
|
||||||
[[nodiscard]]
|
[[nodiscard]]
|
||||||
constexpr T *data() noexcept {
|
constexpr T *data() noexcept {
|
||||||
return m_items;
|
return m_items;
|
||||||
@@ -517,6 +519,12 @@ constexpr void Vector<T, SmallVectorSize, Allocator>::resize(std::size_t size) n
|
|||||||
m_size = size;
|
m_size = size;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
template<typename T, std::size_t SmallVectorSize, typename Allocator>
|
||||||
|
constexpr void Vector<T, SmallVectorSize, Allocator>::reserveResize(std::size_t const size) noexcept(useNoexcept) {
|
||||||
|
reserve(size);
|
||||||
|
resize(size);
|
||||||
|
}
|
||||||
|
|
||||||
template<typename T, std::size_t SmallVectorSize, typename Allocator>
|
template<typename T, std::size_t SmallVectorSize, typename Allocator>
|
||||||
constexpr bool Vector<T, SmallVectorSize, Allocator>::contains(MaybeView_t<T> const&v) const noexcept {
|
constexpr bool Vector<T, SmallVectorSize, Allocator>::contains(MaybeView_t<T> const&v) const noexcept {
|
||||||
for (std::size_t i = 0; i < m_size; ++i) {
|
for (std::size_t i = 0; i < m_size; ++i) {
|
||||||
|
|||||||
Reference in New Issue
Block a user