Boost logo

Boost :

Subject: Re: [boost] [iterator] std::sort on zip_iterator (repost)
From: Steven Ross (spreadsort_at_[hidden])
Date: 2009-05-28 13:09:50


I believe the zip_iterator problem is that *a returns a const. swap(*a, *b)
won't work for that situation; it needs a specialized iter_swap. From my
understanding of Boost::swap, using an equivalent Boost::iter_swap would
resolve the problem.
Additionally, iter_swap can be be faster, and it's what SGI's std::sort
uses.

On Thu, May 28, 2009 at 8:15 AM, Christopher Jefferson <
chris_at_[hidden]> wrote:

>
> On 28 May 2009, at 15:26, Steven Ross wrote:
>
> Is there a boost::iter_swap? It would be useful to enable use of a more
>> specialized iter_swap for sorting. This would apply both to my hybrid
>> algorithms and spreadsort.
>>
>
> One thing to watch out for (you might know this) is that standard libraries
> are not required to use iter_swap for iterators, and in general don't (they
> often use swap(*a,*b)).
>
> Chris
>
> _______________________________________________
> Unsubscribe & other changes:
> http://lists.boost.org/mailman/listinfo.cgi/boost
>


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