Marshall Clow
In Sean Parent's CppCon keynote last week, he went through the process of implementing an algorithm he called "sort_subrange", which takes four iterators describing two ranges, one a subset of the other, and sorts the subrange - as if you had sorted the entire range. (See https://www.youtube.com/watch?v=sWgDk-o-6ZE, starting at about 31:30).
I have implemented this in Boost.Algorithm (crediting Sean) - called partition_sort.
However, while I was doing this, I thought of a different algorithm; one that gathered all the elements into the subrange as if the entire range was sorted, but didn't actually do the sorting.
I've implemented that one, too - but I'm having a bit of trouble coming up with a name.
I've used "partition_subrange", but that not that clear. Sean has suggested "elements_in_subrange" and "elements_within_subrange".
The names you mention, being nouns rather than verbs, don't convey the notion that the algorithm performs a mutating action on the sequence. Some ideas: partition_gather gather_partition partition_group group_partition where "partition" can be used as an object (suffix) or a verb qualifier (prefix) Joaquín M López Muñoz Telefónica