The Dark Corner of STL
MinMax Algorithms
How many problems could one possibly run into when calling a simple algorithm such as std::min?
In this talk, we will take a deep dive into the ergonomics of min-max algorithms and explore several language features in the process:
• reference semantics and lifetime issues
• const correctness and use of const_cast
• costs of using the std::initializer_list
We will finish by exploring the options for addressing these issues when implementing functions with similar semantics.
Šimon Tóth
Ex-Software Engineer and ex-Researcher turned content creator.
Currently on a mission to share my 20 years' worth of Software Engineering experience with the world.