|
-
July 7th, 2009, 01:20 PM
#3
Re: functor or extractor for a vector question
 Originally Posted by Lindley
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.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|