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


On Sat, 11 Apr 2015, FranÃois Dumont wrote:

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.

While this is true, I don't think it is a reason to force extra copies internally when it is just as easy to avoid them (as long as someone is willing to write and test the patch). For iterators in particular, passing by value is useful to force the decay from array to pointer, but there is no need to decay an already decayed type.

https://gcc.gnu.org/ml/libstdc++/2013-09/msg00220.html

(I didn't feel strongly enough to write the patch myself, and still don't)

--
Marc Glisse


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