Using a functor to fill the vector of pointers to samples.