handful and interval

Jacob Carlborg doob at me.com
Sun Sep 2 07:56:09 PDT 2012


On 2012-09-02 16:22, Andrei Alexandrescu wrote:

> Same question about "interval", which is a fair amount more interesting
> if done right. An interval is a pair of values from a type that supports
> inequality comparison. It would have a variety of interval-specific
> operations, of which this would probably be quite popular:
>
> int x;
> ...
> if (x in interval(1, 2))
> {
>      ...
> }

Isn't this a bit like std.range.iota? Perhaps extending that returned 
value with opIn and other functionality.

-- 
/Jacob Carlborg


More information about the Digitalmars-d mailing list