#include #include typedef int T; constexpr int INITIAL_LEN = 10; class Vec { std::size_t cap; std::size_t w_idx; T *arr = nullptr; void resize(std::size_t newsize); public: Vec(); explicit Vec(std::size_t); Vec(std::initializer_list); Vec(const Vec &other); // Copy Vec(Vec &&other) noexcept; // Move Vec &operator=(const Vec &other); // CopyAssign Vec &operator=(Vec &&other) noexcept; // MoveAssign ~Vec(); // Destructor T &operator[](std::size_t) const noexcept; std::size_t size() const; std::size_t capacity() const noexcept; void push_back(const T &value); // May except void push_back(T &&value); void pop_back() noexcept; void clear() noexcept; using iterator = T *; using const_iterator = const T *; iterator begin() noexcept { return arr; } iterator end() noexcept { return arr + w_idx; } const_iterator begin() const noexcept { return arr; } const_iterator end() const noexcept { return arr + w_idx; } }; // std::iterator end() const noexcept; // std::iterator begin() const noexcept;