auto ym0 = YearMonth(2020, Month.jan); auto ym1 = ym0.addYears(1); assert(ym1.year == 2021); assert(ym1.month == Month.jan); // leaves ym0 unchanged assert(ym0.year == 2020); assert(ym0.month == Month.jan);
See Implementation