"IndexType" for ranges

David Nadlinger see at klickverbot.at
Tue Oct 2 11:45:36 PDT 2012


On Tuesday, 2 October 2012 at 17:24:32 UTC, Andrei Alexandrescu 
wrote:
> Yes. Unfortunately there are few, few cases in which size_t is 
> insufficient (e.g. an input range from a file or a large iota, 
> both on 32-bit builds). I personally think these are too few to 
> need formal support.

I'd throw bit arrays into the mix, where 32 bit can also be quite 
small. There might also be some other clever hacks using custom 
index types for representing non-linear data structures as ranges.

The question is whether such ranges are likely to be used as 
random access ranges. I can't come up with a compelling use case 
right now, but I'd rather think twice before throwing support for 
them out of the window and later regretting it. Also, one of the 
simplest ranges (iota) not fitting the range concept has somewhat 
of an odd aftertaste.

David


More information about the Digitalmars-d mailing list