|
Boost : |
From: David Abrahams (david.abrahams_at_[hidden])
Date: 2001-11-24 12:58:22
----- Original Message -----
From: "David Abrahams" <david.abrahams_at_[hidden]>
> ----- Original Message -----
> From: "Toon Knapen" <toon.knapen_at_[hidden]>
>
>
> > > So, I conclude that there's no difference in capability between the
two
> > > implementations, since the straightforward permutation_iterator
doesn't
> > > detect duplicates and force a failure.
> >
> >
> > to which implementation are you comparing it to ?
>
> The one I described in a previous message: the policies class holds the
> random-access iterator to the base of the un-permuted sequence, and the
Base
> object is an iterator over the permutation indices.
BTW, in the above design, the iterator in the Policies class is never
changed unless the iterator is assigned to. A hybrid scheme wherein the Base
iterator is never changed, but the Policies class embeds an iterator over
the permutation idices might be the simplest of all, since you can take
advantage of more compile-time defaults.
-Dave
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk