Array!bool and size_t

Dmitry Olshansky dmitry.olsh at gmail.com
Tue May 15 03:04:50 PDT 2012


On 15.05.2012 13:44, Nicolas Sicard wrote:
> The implementation of std.container.Array!bool makes use of ulong
> instead of size_t as far as sizes and indices are concerned. This makes
> Array!bool inconsistent with other array-like types (including Array!T
> if !is(T==bool)) in 32-bit code. What would be the disadvantages of
> using size_t?
>
> Thanks,
> Nicolas
>
theoretically you can pack 8*2^30+ bits in 1Gb+ of memory. While it's 
doubtful if you can always fetch such big piece of contiguous memory 
from OS it's still possible. And 32bit bit-indexes just fail to address it.

-- 
Dmitry Olshansky


More information about the Digitalmars-d mailing list