For bonus points, can someone either write a stable partition that runs in linear time with no extra storage (or maybe just constant storage) or prove that it is impossible?
You could even be nifty and return a reversed iterator yourself to hide the implementation detail from the caller.
Stable partition with constant storage is harder. I'm pretty sure it's not possible, but I'm not prepared to offer a proof of that. I believe it (at best) turns into NlgN moves (which is how stable_partition performs as well) no matter what exact approach you take.