#ifndef DATE_HPP_ #define DATE_HPP_ #include class Date { private: int m_day; int m_month; int m_year; public: Date(int day, int month, int year) : m_day(day), m_month(month), m_year(year) {} const int& getDay() const { return m_day; } const int& getMonth() const { return m_month; } const int& getYear() const { return m_year; } friend std::ostream& operator<<(std::ostream& os, const Date& d) { os << d.m_day << '.' << d.m_month << '.' << d.m_year; return os; } }; template class _ptr { private: T* m_ptr; public: _ptr(T* ptr = nullptr) : m_ptr(ptr) {} ~_ptr() { delete m_ptr; } _ptr(_ptr& p) { m_ptr = p.m_ptr; p.m_ptr = nullptr; } _ptr& operator=(_ptr& p) { if (&p == this) return *this; delete m_ptr; m_ptr = p.m_ptr; p.m_ptr = nullptr; return *this; } T& operator*() const { return *m_ptr; } T* operator->() const { return m_ptr; } bool isNull() const { return m_ptr == nullptr; } }; const _ptr& compares_dates(const _ptr&, const _ptr&); void exercise_1(); void exercise_2(); #endif