+void
+Grob_array::filter (bool (*predicate) (const Grob *))
+{
+ vsize new_size = 0;
+ for (vsize i = 0; i < grobs_.size (); ++i)
+ if (predicate (grobs_[i]))
+ grobs_[new_size++] = grobs_[i];
+ grobs_.resize (new_size);
+ // could call grobs_.shrink_to_fit () with C++11
+}
+
+void
+Grob_array::filter_map (Grob * (*map_fun) (Grob *))