std::min was used without including the algorithm header. Seems to be implicitly included by something in newer MSVC versions and GCC, however vs16.4 needed a little help here.