Boost logo

Boost Users :

From: Rob Smallshire (rob_at_[hidden])
Date: 2003-01-27 09:07:13


Boosters,

I have implemented a 'virtual container' class (i.e. it looks and behaves
like it contains Objects, but it fact it doesn't) which implements an
iterator interface of what are essentially bidirectional iterators.

The iterators I have now are not STL compliant and I only have 'mutable'
versions of the iterators, with no corresponding const iterators.

Some guidance on how to make the best use of boost::iterator adapter would
be appreciated to create fully STL compliant iterator/const_iterator pairs:

1) Out current iterators (i.e. the Base type which will be adapted) return
smart reference objects when dereferenced, rather than true C++ references
to objects. Will iterator adapter work in this situation?

2) Furthermore, can I use the iterator_adapter to adapt our home-grown
mutable iterator into a STL compliant const_iterator? Do I simply modify the
Reference of the iterator_adapter template type to be a const version of my
smart-reference class?

Many thanks,

Rob


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net