According to section [time.cal.wd.overview]/1 of the C++ standard:
weekdayrepresents a day of the week in the civil calendar. It normally holds values in the range0to6, corresponding to Sunday through Saturday, but it may hold non-negative values outside this range.
At the same time arithmetic operations perform modulo 7 arithmetic forcing the result in the range [0, 6], e.g.
weekday wd(7);
// wd.ok() == false - wd is invalid
++wd; // wd == weekday(1)
// wd.ok() == true - wd silently becomes valid
Why does weekday have such peculiar behavior, particularly why are values outside of [0, 6] allowed but not preserved by arithmetic operations?