Include <algorithm>.

Visual studio was unable to find std::min and std::max.