You were right with your intuition. Although, since you are using an empty vector, you should use the back inserter for your output iterator.
It should look something like:
std::transform(secondVec.being(), secondVec.end(), back_inserter(firstVec), yourFunctor)
And your Functioner looks like this:
void youFunctor(First param) { return param.s1; }
Edit: Boost can help you with the lambda function, so you don't need to create a separate functor for this task. It should also be noted that the function of the lambda function is part of TR1 and will be integrated into the standard C ++ library.
Edit: this is what Meredith said with mem_fun (or member-adapter).
struct Second { First s1; int s2; First getS1() const {return s1;}; };
And then the conversion will look like this:
std::transform(secondVec.being(), secondVec.end(), std::back_inserter(firstVec), std::mem_fun(&Second::getS1))
source share