A reference to the TimeOfDay (this).
auto tod1 = TimeOfDay(7, 12, 0); tod1.roll!"hours"(1); assert(tod1 == TimeOfDay(8, 12, 0)); auto tod2 = TimeOfDay(7, 12, 0); tod2.roll!"hours"(-1); assert(tod2 == TimeOfDay(6, 12, 0)); auto tod3 = TimeOfDay(23, 59, 0); tod3.roll!"minutes"(1); assert(tod3 == TimeOfDay(23, 0, 0)); auto tod4 = TimeOfDay(0, 0, 0); tod4.roll!"minutes"(-1); assert(tod4 == TimeOfDay(0, 59, 0)); auto tod5 = TimeOfDay(23, 59, 59); tod5.roll!"seconds"(1); assert(tod5 == TimeOfDay(23, 59, 0)); auto tod6 = TimeOfDay(0, 0, 0); tod6.roll!"seconds"(-1); assert(tod6 == TimeOfDay(0, 0, 59));
Adds the given number of units to this TimeOfDay, mutating it. A negative number will subtract.
The difference between rolling and adding is that rolling does not affect larger units. For instance, rolling a TimeOfDay one hours's worth of minutes gets the exact same TimeOfDay.
Accepted units are "hours", "minutes", and "seconds".