#pragma once #include // For malloc and free #include // For placement new #include // For std::move and std::forward #include // For std::bad_alloc #include // For returning references template class ContiguousContainer { public: ContiguousContainer(); ~ContiguousContainer(); // Use perfect forwarding for pushBack template void pushBack(Args&&... args); void popBack(); T& operator[](size_t index); size_t getSize() const; // Function to return references to all stored objects std::vector> getAllReferences(); private: T* mData; size_t mSize; size_t mCapacity; void resize(size_t new_capacity); // Resize function to allocate more space }; #include "ContiguousContainer.hpp"