Data Class

Hi guyz. I need class which defines is it or not Leap year. The main idea is that year must choose user. So if u have some ideas please help me
Here's a function which returns true if its argument represents a leap year.
1
2
3
constexpr bool is_leap_year(unsigned const year) noexcept {
  return (year % 4) || (!(year % 100) && (year % 400);
}

Last edited on
Thanks
Topic archived. No new replies allowed.