Quote Originally Posted by Lindley View Post
Yeah, you could. If it were me I'd do:
1) Write a functor which takes pointers or references to myA and myB on construction, and takes a vector<MyData>::value_type as the argument to its operator().
2) The operator() does the two push_backs.
3) Use the functor with std::for_each.
thanks I think that is what I was looking for. The key being using pointers and value_type which I had never used. Let me see if I can code this now.