#pragma once #include #include #include #include class Span { public: Span() = delete; Span(unsigned int size); Span(const Span &other); Span(Span &&other) noexcept; Span &operator=(const Span &other); Span &&operator=(Span &&other) noexcept; ~Span() noexcept; void addNumber(int number); unsigned int shortestSpan() const; unsigned int longestSpan() const; template requires std::same_as, int> void addRange(Iterator begin, Iterator end) { for (Iterator it = begin; it < end; it++) { addNumber(*it); } } class OutOfSpaceException : public std::exception { public: const char *what() const throw(); }; class NoSpanFoundException : public std::exception { public: const char *what() const throw(); }; private: unsigned int _size; std::vector _data; };