Cruft in qpid::framing::Buffer class should be removed

Details

Description

The definition of qpid::framing::Buffer::Iterator seems buggy to me. This is not a bidirectional iterator. It's not even a forward iterator because the iterator state is kept in the referenced buffer object. It is not possible to use a pair of such iterators to form a range, so not many algorithms can be used on them (at least not in a safe manner).

record() and restore() member functions which are aren't really safe to use.
[The Buffer class doesn't keep a stack of recorded locations, so you can't perform
any function calls that might themselves do record()/restore()] This makes it hard to
reason about locally, and hard to ensure globally.

Andrew Stitcher
added a comment - 16/May/12 20:18 There are a few bits of cruft in the Buffer class and interface:
This iterator which actually isn't used by any current code
record() and restore() member functions which are aren't really safe to use.
[The Buffer class doesn't keep a stack of recorded locations, so you can't perform
any function calls that might themselves do record()/restore()] This makes it hard to
reason about locally, and hard to ensure globally.