C++11
C++14
C++17
C++20
Search
std::midpoint
C++20
Calculate the midpoint of two integers safely (without overflow).
std::midpoint(1, 3); // == 2