On Fri, 04 Dec 2015 13:24:16 +0000, ref2401 wrote: > It seem like `size_t` suites well because 'is large enough to represent > an offset into all addressible memory.' > (http://dlang.org/spec/type.html#size_t) > However sometimes I want index to be less the 0 to represent a > particular case.
ptrdiff_t is the signed equivalent of size_t. You could use that -- unless you anticipate having an array longer than two billion elements and are compiling to a 32-bit program.