Boost logo

Boost :

From: Dave Abrahams (abrahams_at_[hidden])
Date: 2000-06-13 16:00:00


--- In boost_at_[hidden], jsiek_at_l... wrote:

> What do you think about the friend instantiation workaround that
I've
> proposed? The one that specializes the wrapper class based on the
> category of the iterator being wrapped. The code I've uploaded has
> this workaround. There's only one thing wrong with this approach
(that
> I can think of). If the iterator uses a "custom" tag that derives
from
> one of the standard tags, then the correct adaptor may not be
chosen.

Your version has the advantage of doing some concept checking on the
wrapped iterators to make sure that they really support (some of) the
operations required. It also has the advantage of being able to wrap
a RandomAccessIterator so it looks like a BidirectionalIterator, with
a truly restricted interface (and why would we want to do that?) My
version has the advantage of being simpler, and working on VC6. If
you can handle the VC6 and custom tags issues, I don't see a reason
not to go with your implementation. We would need much more thorough
tests than the ones I've written, though.

-Dave


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk