solved via #include <algorithm>

That is the craziest thing in the STL