[challenge] Bounded types

Philippe Sigaud philippe.sigaud at gmail.com
Mon Oct 11 18:23:50 PDT 2010


2010/10/11 Tomek Sowiński <just at ask.me>:
> Philippe Sigaud napisał:
>
>> As you can see, an "open or closed for both ends" policy could be
>> interesting to add. In the previous example, is 1.0 a correct value?
>
> It can be handled as in std.random: Bounded!(T, min, max, string bounds = "[)"). But with "[]"
> as default.

Yes, good idea. I suggest that for integral types (+ chars) is
automatically closed at both ends. That what most people want.
The opening make sense only for floating point or custom types.


More information about the Digitalmars-d mailing list