-IMPLEMENT_SIMPLE_SMOBS (Grob_array);
-IMPLEMENT_TYPE_P (Grob_array, "ly:grob-array?");
+void
+Grob_array::filter_map_assign (const Grob_array &src,
+ Grob * (*map_fun) (Grob *))
+{
+ if (&src != this)
+ {
+ grobs_.resize (0);
+ grobs_.reserve (src.grobs_.size ());
+ for (vsize i = 0; i < src.grobs_.size (); i++)
+ if (Grob *grob = map_fun (src.grobs_[i]))
+ grobs_.push_back (grob);
+ // could call grobs_.shrink_to_fit () with C++11
+ }
+ else
+ filter_map (map_fun);
+}