Splitting a range in two according to a predicate is a common
enough need. How do you translate this C++/STL idiom to D/Phobos?


vector<int> source_data;
...
vector<int> good_stuff, bad_stuff;
partition_copy(begin(source_data), end(source_data),
                inserter(good_stuff, end(good_stuff)),
                inserter(bad_stuff, end(bad_stuff)),
                is_good);


If this is not handy to implement with the current Phobos, is it
worth adding a similar function to Phobos?

Thank you,
bye,
bearophile

Reply via email to