If necessary, you can use std in this task::vector and std::array. Other standard containers cannot be used. It is necessary to implement the template class Deque - a highly simplified analogue of the class std::deque. The type T does not have to have a default constructor in order to be stored in a Deque. Your Deque should have the following functionality: Constructors: by default, copy constructor, constructor from int, constructor from (int, const T&). The deque assignment operator. The size() method, which returns the current size of the container. Index conversion: in square brackets (without checking for going abroad) and at (throwing std::out_of_range). It should work for a guaranteed O(1). push_back, pop_back, push_front, pop_front methods. They must work for amortized O(1). There must be an internal iterator type (with a small letter, in the best traditions of STL). This type, in addition to the obvious, should support: Increment, decrement Addition with integers Comparison < > <= >= == != Taking the difference of two iterators Dereference (unary asterisk), the result is T& Operator ->, the result is T* There should also be a constant iterator const_iterator. Its difference from the usual iterator is that it does not allow you to change the element lying under it. Conversion (including implicit) of a non-constant iterator to a constant one is acceptable, but not back. It is necessary to implement a constant iterator so that its code is not a copy paste of the code of a regular iterator. The push_back, push_front, pop_back, and pop_front operations must not disable pointers and references to other deck elements. The pop_back and pop_front operations, in addition, should also not disable iterators. At the same time, it is impossible to store a pointer to the deque object itself in the iterator: dereference of the iterator should require in most cases only one dereference of the pointer, occasionally there may be two, but never three. The begin, cbegin, end and cend methods, which return non-constant and constant iterators to the beginning and to the “element after the end” of the container, respectively. If the container itself is constant, then the begin and end methods also return constant iterators. The end decrement should give an iterator for the last element, subtracting integers from the end should also work correctly and give iterators for the corresponding elements. reverse iterators, as well as the rbegin, rend, crbegin, and crend methods. The insert(iterator, const T&) method, which inserts into the container by iterator. All the elements on the right are shifted one to the right, the insertion works in linear time. The erase(iterator) method, which removes an element from the container by iterator. All the elements on the right are shifted one to the left, the deletion works in linear time. All methods of your Deque (except insert and erase by iterator) must be strictly exception-safe. This means that in the case of an exception in the constructor or assignment operator of type T during the execution of any deck method, the latter must return to its original state, which was before the start of the method execution, and throw the exception up into the calling code. Your file should not have the main function, and the file itself should be called deque.h. Your code will be included via include in the program containing the tests.