#include //for div #include "fastdate.h" using namespace std; fastdate& fastdate::operator++() { if (++day > length[month]) { day = 1; if (++month > december) { month = january; ++year; } } return *this; } fastdate& fastdate::operator+=(int count) { div_t d = div(count, 365); if (d.rem < 0) { //Make sure remainder is non-negative. d.rem += 365; --d.quot; } year += d.quot; for (day += d.rem; day > length[month];) { day -= length[month]; if (++month > december) { month = january; ++year; } } return *this; }