BitArray/BitFields - Review

Dmitry Olshansky dmitry.olsh at gmail.com
Sat Jul 28 14:19:49 PDT 2012


On 29-Jul-12 01:07, Jonathan M Davis wrote:
> On Sunday, July 29, 2012 00:58:59 Dmitry Olshansky wrote:
>> My solution is make slices different type e.g. BitSlice.
>> It's always reference to the original BitArray. Array itself still can
>> be either compact or not. All operations with slice go to array (and
>> still check if they can use word-aligned speed up).
>>
>> How does it sound?
>
> I would point out that while hasSlicing doesn't currently check for it, if
> opSlice doesn't return a type which is assignable to the original range, it
> won't work in a lot of Phobos functions. I keep meaning to bring that up for
> discussion in the main newsgroup.

BitArray isn't and shouldn't be a range. It's a container.
So BitSlice is a range over BitArray. What am I missing?



-- 
Dmitry Olshansky


More information about the Digitalmars-d-learn mailing list