Above you changed int to std::size_t and that would also be the best fix here too.