This is the mail archive of the libstdc++@gcc.gnu.org mailing list for the libstdc++ project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [libstdc++] pdqsort - a faster std::sort


Hello

I think comparator is taken by copy simply because the Standard signature is taking it by copy. We expect gcc to do a good job to optimize away the intermediate copy. You should rely run bench to check if it has any impact on the perf.

Note that I also plan to implement PR 60519 thanks to those wrapper as all algos are relying on it. It is a very nice central place to implement additional checks.

FranÃois


On 09/04/2015 00:51, Marc Glisse wrote:
On Thu, 9 Apr 2015, Orson Peters wrote:

1. Should iter_swap be used like swap (using std::swap; followed by
   unqualified lookup), or should it be fully qualified as
   std::iter_swap?

Fully qualified.

2. Is there any particular reason _Iter_comp_iter and co store copies
   of the comparator, and not a reference?

Probably not. But if that changes, it should be a separate patch, submitted in a separate email.

Note that you can search the mailing list for explanations on the strange functor stuff if you are curious, it is quite recent. Here are some random links, but the conversation was spread over many more months, the interesting parts may be in other threads (look for the name "FranÃois Dumont").

https://gcc.gnu.org/ml/libstdc++/2012-05/msg00006.html
https://gcc.gnu.org/ml/libstdc++/2013-09/msg00004.html
https://gcc.gnu.org/ml/libstdc++/2013-09/msg00150.html



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]