std::min
and std::max
in the <algorithm>
library. As they're templates they return the min and max for every type that implements the <
operator (or you can supply a functor for your custom comparison).
See Algorithms library (link to cppreference.com).