Compares two YearMonth values and returns -1, 0, or 1 if the first is less, equal, or greater than the second.
auto ym = YearMonth(2000, Month.nov); assert(ym.opCmp(YearMonth(2000, Month.nov)) == 0); assert(ym.opCmp(YearMonth(2000, Month.oct)) == 1); assert(ym.opCmp(YearMonth(2000, Month.dec)) == -1); assert(ym.opCmp(YearMonth(2001, Month.nov)) == -1);
Compares two YearMonth values and returns -1, 0, or 1 if the first is less, equal, or greater than the second.