You make a lot of claims for C++. E.g.
EarlPurple wrote:
... With regards to sorting, it has been shown that if you can inline the comparison then std::sort heavily outperforms the C qsort function. ...
Does it outperform it for:
- The empty set.
- Small numbers of items.
- Large numbers of items that are almost sorted to start with.
- A number of items that is too large for it to hold in real memory, because of its overheads.
In any case, here you are not comparing C with C++, you are only comparing one fixed library routine with the C++ approach.
There is no such thing as a "best" language. Indeed, the whole concept of one language even being "better" than another is dependent on knowing what hardware it will be running on, what compiler and what library code. I have seen some horrendously buggy C compilers.
Anything written in C++ can be hand-translated into C, and made more efficient. Admittedly that would not a simple process, and it could very time consuming, but it is true.
Anything written in C can be almost trivially hand-translated into C++. I've done exactly this quite often, It is a simple process and quick. However, it will likely be very inefficient, and any attempt to improve the code by tinkering with it will be challenged by the overheads inherent in C++.
(Although the code could, of course, be vastly "generalised"... but that is likely to be completely irrelevant.)
_________________
"Striking up conversations with strangers is an autistic person's version of extreme sports."
Kamran Nazeer