Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

The only real difference between qsort and std::sort in terms of code generation, is that for std::sort the default assumption is to function clone and for qsort it is to generate the full slow function. Now the compiler will in most cases detect that qsort can be cloned or inlined, but sometimes it might decide not to and the fallback is, in most cases slower then the C++ fallback.

PS.: I'm just annoyed that my generic C hashtable that is written in a qsort style doesn't get function copied/inlined when it's used for more than one type.



You can't just ignore that qsort is implemented in a different library just because it could be implemented inline in the header.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: