Iterators and Ranges: Comparing C++ to D to Rust
Ola Fosheim Grøstad
ola.fosheim.grostad at gmail.com
Mon Jun 14 18:05:48 UTC 2021
On Monday, 14 June 2021 at 17:49:46 UTC, Ola Fosheim Grøstad
wrote:
> Then maybe a table pointer would be a pointer to the chunk + a
> bitmask? But then it makes more sense to use a ranges approach.
> So you point to first chunk with bitmask and the last chunk
> with bitmask. So pointing to the end would be pointing to the
> last chunk with a zero-bitmask? Not sure… :-D
No. I think I cannot have empty ranges to signify the beginning
or end. Since there might be only one chunk in the container. So
then there would be an ambiguity as to whether I point to the
empty space at the beginning or the end.
So probably better to have two types: bitmasked ranges, and
explicitly indexed table pointers. Perhaps?
More information about the Digitalmars-d
mailing list