Suppose I have a class
struct Foo {double x; double y;}
and std::vector<Foo> xy;
I also have a function to pull out the x
members:
std::vector<double> bar(const std::vector<Foo>& xy);
which loops through each element of xy
.
Is there a way of using the C++ standard library so I can avoid an explicit for
loop?
Aucun commentaire:
Enregistrer un commentaire