staticsort and staticranksort use the same iterators