From c50ed74e3a583d539977059ffb8fd0198b54eb88 Mon Sep 17 00:00:00 2001 From: angeld55 Date: Wed, 13 Apr 2022 02:32:26 +0300 Subject: date mutable change --- Sem. 06/Event/Date.h | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'Sem. 06/Event/Date.h') diff --git a/Sem. 06/Event/Date.h b/Sem. 06/Event/Date.h index c1c071f..2e28ffa 100644 --- a/Sem. 06/Event/Date.h +++ b/Sem. 06/Event/Date.h @@ -8,10 +8,11 @@ class Date size_t MAX_DAYS[12] = { 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 }; - int dayOfWeek; - bool isModified = true; + mutable int dayOfWeek; + mutable bool isModified = true; bool isLeapYear() const; + void validateDateByChangedCalendars(); public: Date(size_t day, size_t month, size_t year); @@ -28,6 +29,6 @@ public: bool areEqual(const Date& other) const; - int getDayOfWeek(); //cant be const, because of changings dayOfWeek and isModified + int getDayOfWeek() const; //cant be const, because of changings dayOfWeek and isModified // can we get around this ?? }; -- cgit v1.3.1-23-gd82d