C++11, which you are using if this compiles, allows the following:
for (string& feature : features) {
// do something with `feature`
}
This is the range-based for loop.
If you don’t want to mutate the feature, you can also declare it as string const&
(or just string
, but that will cause an unnecessary copy).