Replace std::size_t with signed int which is the proper way to write the permutation