On Tuesday, 8 September 2015 at 07:17:01 UTC, Ali Çehreli wrote:
https://github.com/D-Programming-Language/phobos/blob/master/std/range/package.d#L4630
auto iota(B, E)(B begin, E end)
if (isFloatingPoint!(CommonType!(B, E)))
{
return iota(begin, end, 1.0);
}
Such kind of stuff would better be written as
auto iota(B, E)(B begin, E end)
{
return iota(begin, end, cast(CommonType!(B, E))1.0);
}
this doesn't need a constraint anymore, or maybe use
if(isNumeric!(CommonType!(B, E)))
I tend to use the above kind of cast often, because I like to
work with ubyte or ushort, and every f***ing number literal
changes the type to uint :-/