Hi there Josh.
First of all the interator sample has an error
std::vector myvector = {"Bob", "Jane", "Fred"};
for (auto it = myvector.begin(); it != myvector.end(); it++)
{
std::string element = (*it);
Print(element);
}
should be
std::vector<std::string> myvector = {"Bob", "Jane", "Fred"};
for (auto it = myvector.begin(); it != myvector.end(); it++)
{
std::string element = (*it);
Print(element);
}
secondly you can create the vector and iterate in a less mysterious way
if you don't care what myvector actually is.
auto myvector = { "Bob", "Jane", "Fred" };
for each( auto element in myvector )
{
Print(element);
}
if you do care its
std::vector<std::string> myvector = { "Bob", "Jane", "Fred" };
for each( auto element in myvector )
{
Print(element);
}