|
|
|
|
|
by shereadsthenews
2723 days ago
|
|
That only makes sense if you are planning to offer two implementations of your library. Which I of course urge you to not do. This article is about the STL headers. The reason std::sort beats the pants off all other languages’ sort routines is because the iterators of every collection, all specializations of swap, and the comparator can all be visible to the compiler. If they weren’t, it would be a lot slower. Premature optimization is not really a thing but foreclosing future avenues of optimization definitely can be. |
|
Okay. I'm going to stop this thread right there and take some opportunity to provide some mentoring. I hope you accept this, as it will help in your career.
Read this paper. It is a classic.
https://pic.plover.com/knuth-GOTO.pdf