I am writing a class for holding dates in c++, and I found the following problem:
I have a number of days N since a reference date (in
N
bool IsLeapYear(int year) { boost::gregorian::date d1(year, 1, 1); boost::gregorian::date d2 = d1 + boost::gregorian::years(1); boost::gregorian::date_duration diff = d2 - d1; return diff.days() != 365; }