// License: Modified MIT (NON-AI) // See the LICENSE file in the root directory for license information. // Copyright 2025 Timothy Prepscius #pragma once #include "FilledArray.h" #include "StackArray.hpp" #include "../debug/Debug.h" #include "../assert/debug_assert.h" #include #include // memcpy #include "../threads/TestCollision.h" namespace tjp { namespace core { template struct FilledArray : StackArray { using Super = StackArray; using iterator = typename Super::iterator; using const_iterator = typename Super::const_iterator; void insert(const T &element) { this->push_back(element); } void erase (typename Super::iterator i) { if (i == this->end()) return; auto &back = this->back(); if (i != &back) *i = std::move(back); this->pop_back(); } void erase (const T &element) { erase(find(element)); } iterator find (const T &element) { // now iterator all except for what used to be the end element for (auto i=this->begin(); i!=this->end(); ++i) { if (*i == element) { // the end element was the last element return i; } } return this->end(); } } ; } // namespace utilities } // namespace