Skip to content

Proxy Iterators #45

@keean

Description

@keean

@shelby3 Another C++ mess:
http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2015/p0022r0.html

We need to think about this carefully in light of wanting to use Pony style references. The immediate solution that occurs to be is that we need a special "bit-reference" type that encodes a bit-shift and mask, so you would effectively encode an address, and a start and stop bit range:

struct bitReference {
   *word address,
   int shift
}

where the dereference operation would be:

((*bitref.word) >> shift) & 1

The real reason I think C++ fails, is because it actually uses the concrete dereference '*' directly, instead of implementing Stepanov's Readable, Writeable, Mutable Concepts. With dereference becoming a type-class you can totally avoid proxy iterators. It is probably too big a change with all that code already out there for C++...

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions