std.range.iota enhancement: supporting more types (AKA issue 10762)

Francesco Cattoglio francesco.cattoglio at gmail.com
Sat Dec 28 11:22:24 PST 2013


On Saturday, 28 December 2013 at 16:13:45 UTC, Jakob Ovrum wrote:
> Alright, so require division for bidirectionality when given a 
> custom step. There's no reason division should be required for 
> bidirectionality in the most common case of iota(start, end).

Ok, now I finally get your point. It goes something along the 
lines of: "if no step is provided, then we can assume end can be 
reached by just stepping forward (incrementing by one)". It makes 
sense, but personally I don't like to make assumptions. I think 
assumptions in library code are one of the worst sources of nasty 
bugs in user code.


More information about the Digitalmars-d mailing list