BitArray new design - slice problems

Dmitry Olshansky dmitry.olsh at gmail.com
Thu Jan 17 11:36:33 PST 2013


17-Jan-2013 22:34, Era Scarecrow пишет:
>>
>>>  Thoughts? Feedback? I'm about ready to drop this and resume my
>>> previous version and enhance it with recent experiences.
>>
>> Feel free to do it how you see it. It's just that I think the
>> semantics of the previous version can't be improved to a consistent
>> state.
>
>   Sure they can, drop the compact part of it and leave it fully dynamic
> (or vise-verse). But that would make some people unhappy; On the other
> hand we could go hybrid where I take the new storage implementations and
> allow template versions based on needs, remove the compact related
> stuff, but then it's almost back to the separate slice design. Hmmm...
>
>   Should the slices be 'use at your own risk' when you tamper with the
> original BitArray? How else should it be?

I'm thinking that a opSlice of stack-allocated must be @system and a 
heap allocated can be @safe.

Possibly there are better ways to handle this.

-- 
Dmitry Olshansky


More information about the Digitalmars-d-learn mailing list