I want to copy the a
values from the foos
vector into another vector with just the int
value. What's the fastest way to do this?
#include <vector>
struct Foo {
int a;
};
int main() {
std::vector<Foo> foos;
for(int i = 0; i < 100; i++)
foos[i].a = i;
std::vector<int> somenumbers;
//Fastest way to copy the ints from the struct into the somenumbers vector?
return 0;
}