Daily bit(e) of C++ | std::min, std::max, std::minmax
Daily bit(e) of C++ ♻️54, The min-max algorithms: std::min, std::max, std::minmax.
The min-max algorithms are relatively simple but offer multiple overloads suitable for different use cases.
In C++11, the std::minmax algorithm was added to std::min and std::max, and all three algorithms received an overload for std::initializer_list.
C++20 introduced corresponding versions in the std::ranges namespace and a new overload that operates on a range.