News for hackers. Stuff that matters.
Re:Modern programming languages require generics by hermitdev on Tuesday May 24, 2022 @05:58PM (#31497973)
> Am I doing something wrong?

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

Re:Modern programming languages require generics by uecker on Wednesday May 25, 2022 @11:56AM (#31506350)
This has nothing to do with C++:

https://godbolt.org/z/zTe8jocsE

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.