Date: 2003-05-07 02:36:08
In the Boost "iterator_adaptor" library, the "indirect_iterator_adaptor"
template allows to create, having an object pointers container,
an iterator behaving like an iterator on a container of objects
(without dereferences). Is is therefore usable with the usual STL
algorithms. For the moment, this adaptor only works with "input_iterator"
and "random_access_iterator" types iterators.
The "indirect_output_iterator_adaptor" template behaves
the same way, but with "output_iterator" type iterators. This template :
- Does the insertion of a pointer in the container the iterators points
- And before that, does the allocation of a new object the get this
Therefore, it is possible to use in insertion mode, containers of
objects pointers, exactly like objects containers.
The code takes about 40 lines. Any interest ?
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk