Re:Modern programming languages require generics
by uecker on Wednesday May 25, 2022 @11:56AM
(#31506350)
This has nothing to do with C++:
Re:Modern programming languages require generics
by adrianN on Friday May 27, 2022 @12:50AM
(#31526112)
Well the whole point of the exercise was to see whether the C-version of qsort would be optimized in the same way as templated code when the compiler can see the whole thing instead of just the declaration. That's why I didn't write templated code.
Yes, you just compiled C code as C++. Actually write it as C++ (get rid of the void* mostly) and your program becomes a constant time evaluation: https://godbolt.org/z/5fedo8s5q