The C++ driver has a need to synthesize a bson_iter_t at a known offset within a document.
Currently, it resorts to messing around with the internals of bson_iter_t to accomplish that:
It would be much better for the C++ driver if the C driver offered bson_iter_init_from_data_and_offset, which worked like bson_iter_init_from_data, but also took an offset into the object.
Without this, the C++ driver can only correct this misuse of the C driver by either:
- Exposing the bson_iter_t as a member of the document,array::element class, which would break the encapsulation of the C driver, and make us ABI dependent.
- Putting a type erased bson_iter_t on the heap for every document,array::view class, which would defeat performance of view types.
Neither of the above seems palatable.