I believe in D one should be able to write a RangedInt(int lowerBound, int upperBound) type that would make sure it contains value in the range specified (that would require runtime checks, but I think that's acceptable, those check can be disabled in release). Could be suitable for DayOfWeek, Month, etc.