class SomeType { int32_t variable; }
std::vector<SomeType> myVector(10);
// ... code to work with myVector
std::vector<int32_t> myOtherVector;
for(int i = 0; i < myVector.size(); i++)
{
myOtherVector.push_back(myVector[i].variable);
}
Is there a better way to do this? I've seen how I can use a lambda to do complex initialization, but I can't figure out how to "map" (in C# terms) a Type's certain fields onto this new vector.