The units of time to validate.
The number to validate.
The file that the DateTimeException will list if thrown.
The line number that the DateTimeException will list if thrown.
DateTimeException if valid!units(value) is false.
import std.exception : assertThrown, assertNotThrown; assertNotThrown(enforceValid!"months"(10)); assertNotThrown(enforceValid!"seconds"(40)); assertThrown!DateTimeException(enforceValid!"months"(0)); assertThrown!DateTimeException(enforceValid!"hours"(24)); assertThrown!DateTimeException(enforceValid!"minutes"(60)); assertThrown!DateTimeException(enforceValid!"seconds"(60));