3 ms·
The classic example is quicksort. qsort takes a function pointer, but std::sort is a template. This means that the machinery can be inlined more often in C++ th
by steveklabnik 6y ago
The classic example is quicksort. qsort takes a function pointer, but std::sort is a template. This means that the machinery can be inlined more often in C++ than C.
https://stackoverflow.com/questions/18002087/qsort-vs-stdsort-comparison-function-philosophical-difference https://stackoverflow.com/questions/18002087/qsort-vs-stdsor...