#pragma once #include #include #include #include #include #include #include #include template concept resetable = requires(T val) { val.reset(); }; template requires std::default_initializable && resetable class allocPool { public: explicit allocPool(size_t defaultAllocNumbers = 1000); T *getPtr(); void returnPtr(T *ptr); private: std::vector vec; std::unordered_map positionMap; size_t pivot; void initArray(size_t amount); void initObjects(size_t startIdx, size_t amount); void resizeVec(); };