Boost logo

Boost :

From: Toon Knapen (toon.knapen_at_[hidden])
Date: 2001-11-24 13:29:47

> Not at all: you're storing two iterators in the adaptor; I'm storing two
> iterators. In fact, my latest suggestion stores the same iterators you're
> storing, in the same places. There's simply no need to move the Base
> iterator, since you can implement dereference() in the Policies class as:
> template <class IteratorAdaptor>
> typename IteratorAdaptor::reference
> dereference(const IteratorAdaptor& x) const
> { return *(*(x.policies().order_it_) + x.base()); }

OK. So I guess you meant in :
" BTW, in the above design, the iterator in the Policies class is never
changed unless the iterator is assigned to .. "
that the _Base_ is never changed to traverse the sequence.

>>>since you can take
>>>advantage of more compile-time defaults.
>>which specifically are you thinking of ?
> The mechanisms which compute the default value_type, reference, and pointer
> from the Base iterator type. When the Base object iterates over permutation
> indices, you don't get any of that.


So I guess we converge to the scheme were the Base is the actual random
iterator and which is the second argument to the
make_permutation_iterator such that the past-the-end can be specified by
means of the first argument

Boost list run by bdawes at, gregod at, cpdaniel at, john at