Include missing <algorithm> header for std::min