Interesting aside: There are some things that are faster in C++ than C, for example the standard library sort functions are massively faster because the compiler can in-line the comparison.
Well, yes you are correct. However if you need the fastest sorting you're probably gonna inline the comparison regardless of language. If qsort is slow due to the function pointer comparison just move it inline manually.
Comments
Interesting aside: There are some things that are faster in C++ than C, for example the standard library sort functions are massively faster because the compiler can in-line the comparison.
Well, yes you are correct. However if you need the fastest sorting you're probably gonna inline the comparison regardless of language. If qsort is slow due to the function pointer comparison just move it inline manually.
The performance is the same if you put the qsort implementation in a header.
http://www.agottem.com/blog/inlining_qsort_sort
or use link-time compile generation (slow, and it might not work for huge projects like gcc/webkit, but if split into shared modules it can)