#ifndef OPTIONAL_H #define OPTIONAL_H #include class invalid_optional_access: public std::runtime_error { using runtime_error::runtime_error; }; class Optional_Integer { public: Optional_Integer(int i); Optional_Integer(Optional_Integer const&); ~Optional_Integer(); Optional_Integer() = default; Optional_Integer & operator=(int); Optional_Integer & operator=(Optional_Integer const &); int & operator*() noexcept; int & value(); bool has_value() const noexcept; void reset(); void swap(Optional_Integer &); private: int* data {}; }; #endif