Boost logo

Boost :

From: David Abrahams (david.abrahams_at_[hidden])
Date: 2001-11-24 12:43:59


----- Original Message -----
From: "Toon Knapen" <toon.knapen_at_[hidden]>

> David Abrahams wrote:
>
> > 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.

> As I said in my first
> mail, you talk about a permutation adaptor in you OOPSLA paper but
> AFAICT it's not in boost

Correct.

> : that's why I wrote my own.

Understood. My initial impression was that your implementation was rather
complicated, considering the the functionality you were trying to acheive,
so I thought it would be worth discussing alternatives.

> > It is harder for you to assert that two iterators being compared
actually
> > refer to the same sequence.
>
> that's hard indeed.
>
> What's also not intuitive I guess is that specifying the past-the-end
> iterator. It is based on the second argument (the order) instead of the
> first.

Yep.


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