auto ym0 = YearMonth(2020, Month.jan); ym0.add!"months"(1); assert(ym0.year == 2020); assert(ym0.month == Month.feb); auto ym1 = ym0.add!"months"(1); assert(ym1.year == 2020); assert(ym1.month == Month.mar); // also changes ym0 assert(ym0.year == 2020); assert(ym0.month == Month.mar); ym1.add!"months"(10); assert(ym1.year == 2021); assert(ym1.month == Month.jan); ym1.add!"months"(-13); assert(ym1.year == 2019); assert(ym1.month == Month.dec);