antic C style qsort (will be benchmarked against std::sort)
| 17 | |
| 18 | // antic C style qsort (will be benchmarked against std::sort) |
| 19 | void qsort_vec_int(std::vector<int>& v) |
| 20 | { |
| 21 | auto cmp = [](const void* a, const void* b) { |
| 22 | return (*(static_cast<const int*>(a)) - *(static_cast<const int*>(b))); |
| 23 | }; |
| 24 | qsort(v.data(), v.size(), sizeof(int), cmp); |
| 25 | } |
| 26 | |
| 27 | // Benchmarked function : several sub parts of this function are benchmarked separately |
| 28 | void benchmark_example() |