On 02-09-2012 16:22, Andrei Alexandrescu wrote:int x; ... if (x in interval(1, 2)) { ... }I don't deal much in this sort of code, but I can see it being useful (it's certainly prettier than writing the checks out manually). I don't really know what else I would expect from such a type, though.
Hm, maybe assert(interval(1, 3) & interval(2, 4) == interval(2, 3)) and similar operations?
David