Bug or feature? iota has different semantics for integer and float arguments

Arredondo arm.plus at gmail.com
Fri Jan 6 23:23:08 UTC 2023


Consider:

```
import std.range.iota;
auto r = iota(5, 0);
```

`r` is an empty range, as it should be. But if you call:

```
auto r = iota(5.0, 0);
```

then you get an exception (incorrect startup parameters).

This was unexpected, and a pain to debug. What is the rationale 
behind iota having different semantics depending on whether the 
arguments are floats or not?

Arredondo.


More information about the Digitalmars-d-learn mailing list