Many thanks to you both, Lars and André. I'm still pretty ignorant when it 
comes to functors. I wrote a template function to achieve my goals. Is 
your way better, or is it just a matter of style?

A

template <class A, class B>
std::vector<A> const getFirst(std::vector<std::pair<A,B> > const & pairVec)
{
        typedef std::vector<std::pair<A,B> > vec_pair;

        std::vector<A> first(pairVec.size());

        for (vec_pair::size_type i = 0; i < pairVec.size(); ++i) {
                first[i] = pairVec[i].first;
        }

        return first;
}

Reply via email to