stable_partition(vect.begin(), vect.end(), [](int x) { return x % 2 == 0; }); partition(vect.begin(), vect.end(), [](int x) { return x % 2 == 0; });
上面的代码是为了解释两者之间的区别。
c++ algorithm parameters partition
algorithm ×1
c++ ×1
parameters ×1
partition ×1