diff --git a/deps/ox/src/ox/std/array.hpp b/deps/ox/src/ox/std/array.hpp index ed24782f..bf231977 100644 --- a/deps/ox/src/ox/std/array.hpp +++ b/deps/ox/src/ox/std/array.hpp @@ -146,7 +146,7 @@ class Array { constexpr Array(Array &&other) noexcept; - ~Array(); + ~Array() = default; constexpr iterator<> begin() noexcept { return iterator<>(&m_items[0], 0, ArraySize); @@ -190,24 +190,9 @@ class Array { constexpr const T &operator[](std::size_t i) const noexcept; - Result front() noexcept; - - Result front() const noexcept; - - Result back() noexcept; - - Result back() const noexcept; - [[nodiscard]] constexpr std::size_t size() const noexcept; - [[nodiscard]] - constexpr bool empty() const noexcept; - - constexpr void clear(); - - constexpr void resize(std::size_t size); - [[nodiscard]] constexpr T *data() noexcept { return m_items; @@ -221,40 +206,6 @@ class Array { [[nodiscard]] constexpr bool contains(const T&) const; - constexpr void insert(std::size_t pos, const T &val); - - template - constexpr T &emplace_back(Args&&... args); - - constexpr void push_back(const T &item); - - constexpr void pop_back(); - - /** - * Removes an item from the Array. - * @param pos iterator at the point to remove - * @return Error if index is out of bounds - */ - constexpr Result> erase(const iterator<> &pos); - - /** - * Removes an item from the Array. - * @param pos position of item to remove - * @return Error if index is out of bounds - */ - constexpr Result> erase(std::size_t pos); - - /** - * Moves the last item in the Array to position pos and decrements the - * size by 1. - * @param pos position of item to remove - * @return Error if index is out of bounds - */ - constexpr Error unordered_erase(std::size_t pos); - - private: - constexpr void expandCap(std::size_t cap); - }; template @@ -295,10 +246,6 @@ constexpr Array::Array(Array &&other) noexcept { } } -template -Array::~Array() { -} - template constexpr bool Array::operator==(const Array &other) const { for (std::size_t i = 0; i < ArraySize; i++) { @@ -355,15 +302,4 @@ constexpr bool Array::contains(const T &v) const { return false; } -template -constexpr void Array::expandCap(std::size_t cap) { - auto oldItems = m_items; - if (oldItems) { // move over old items - const auto itRange = ox::min(cap, ArraySize); - for (std::size_t i = 0; i < itRange; ++i) { - new (&m_items[i]) T(std::move(oldItems[i])); - } - } -} - }