Weird issue with std.range.iota.length

H. S. Teoh via Digitalmars-d digitalmars-d at puremagic.com
Fri Feb 12 11:10:57 PST 2016


On Fri, Feb 12, 2016 at 02:00:29PM -0500, Andrei Alexandrescu via Digitalmars-d wrote:
> On 02/12/2016 12:58 PM, H. S. Teoh via Digitalmars-d wrote:
> >IMO, fixing a specific type for length is a mistake.  Truly generic
> >code should treat the length as an opaque type (possibly satisfying
> >some constraints, like <-comparable, ==-comparable, and maybe
> >supporting basic arithmetic operations), and should use generic
> >templates like CommonType!(...) if it needs to work with multiple
> >length types.
> 
> Tried that for a while, it quickly became a mess of entangled
> intestines.  Not worth it. -- Andrei

The intestines are still visible in iota(), and anything that uses it in
32-bit.


T

-- 
This is a tpyo.


More information about the Digitalmars-d mailing list