#pragma once #include #include #include namespace geode::stl { GEODE_DLL void* operatorNew(std::size_t size); GEODE_DLL void operatorDelete(void* ptr); template struct allocator { using value_type = T; using size_type = std::size_t; using difference_type = std::ptrdiff_t; using propagate_on_container_move_assignment = std::true_type; constexpr allocator() noexcept {} constexpr allocator(const allocator& other) noexcept {} template constexpr allocator(const allocator& other) noexcept {} constexpr ~allocator() {} [[nodiscard]] T* allocate(std::size_t n) { return reinterpret_cast(operatorNew(n * sizeof(T))); } void deallocate(T* p, std::size_t n) { operatorDelete(reinterpret_cast(p)); } }; }