[phobos] datetime review

Philippe Sigaud philippe.sigaud at gmail.com
Sun Oct 10 05:56:00 PDT 2010


On Sun, Oct 10, 2010 at 03:40, Denis <2korden at gmail.com> wrote:
> 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.

What about posting that as a [challenge] on the main D newsgroup?

It's also interesting for floating point values between 0 and 1, for
probabilities or whatever field that's normalized.
Heck, even for defining letters, digits, etc.

alias Ranged!(char, 'a','z') letters;
alias Ranged!(char, 'A', 'Z') Letters;
alias Ranged!(char, '0', '9') digits;


More information about the phobos mailing list