I tried to use CPP"s built-in array as the container at the bottom of the loop queue
there is a piece of code to reallocate memory
I simplified the code, one of which is as follows
template <typename T, typename Allocator>
inline void Queue<T, Allocator, T *>::reallocate(size_t size) {
auto new_container {Allocator::operator new (sizeof(T) * size)};
auto cursor {this->first};
for(difference_type i {0}; cursor not_eq this->last;) {
try {
new (new_container + iPP) T(move(*cursorPP));
}catch(...) {
try {
Allocator::destroy(new_container, new_container + i);
}catch(...) {
std::terminate();
}
Allocator::operator delete (new_container);
throw;
}
}
//...
}