This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
Re: [libstdc++] pdqsort - a faster std::sort
- From: Jonathan Wakely <jwakely at redhat dot com>
- To: Christopher Jefferson <chris at bubblescope dot net>
- Cc: Orson Peters <orsonpeters at gmail dot com>, libstdc++ <libstdc++ at gcc dot gnu dot org>
- Date: Wed, 8 Apr 2015 11:50:23 +0100
- Subject: Re: [libstdc++] pdqsort - a faster std::sort
- Authentication-results: sourceware.org; auth=none
- References: <CAJxLxMXy4gqAWfXj_p1tyyUSj4PqFp3ASzdxFtyDk2W1F_PdsQ at mail dot gmail dot com> <20150407135025 dot GF9755 at redhat dot com> <CAJxLxMVEW-+bSFyDs7sWytEMKVrhMpcQxk-9QetWem8ZtSeSxg at mail dot gmail dot com> <CAJxLxMWkj7kKteFh7YWHv5gr+Fge_2VeN6QdJ_TFqW2nUtin=w at mail dot gmail dot com> <CA+jCFLvDjSjPSF+dKDVuKWW-hsSK_LC3c=VwiFEhhx0EOyiqAA at mail dot gmail dot com>
Thanks for chiming in, Chris, I was hoping you'd be able to look into
this proposal.
On 08/04/15 10:35 +0100, Christopher Jefferson wrote:
* I assume the sort works on move-only types in C++11? (I can see you
make use of move, but do you require it?).
- There was a reason (and I can't remember what it was now!) that we
used 'iter_swap' rather than 'swap(*a,*b)' on iterators. I think it
might be required to allow sorting std::vector<bool>? Either way, it
might be worth trying it.
Using iter_swap() does the "std swap two step" [1] for you, could that
be one reason?
[1] http://ericniebler.com/2014/10/21/customization-point-design-in-c11-and-beyond/