Doesn't an iterator have to be deferenced before using? I can't understand why
for_each(vecResult.begin(), vecResult.end(), [](auto counter) {cout << counter << endl;
});
is working (showing the contents of the vector) but
for_each(vecResult.begin(), vecResult.end(), [](auto counter) {cout << *counter << endl;
});
is not.(My visual studio shows an error message
"'<<':illegal for class)