, ++ 11, :
for (auto i : MyVector)
{
std::cout << i;
}
BOOST_FOREACH ++ 03:
BOOST_FOREACH(int& i, MyVector)
{
std::cout << i;
}
std::copy:
std::copy(MyVector.begin(),
MyVector.end(),
std::ostream_iterator<int>(std::cout, "\n"));
, at() , , . , , . , , . :
for (std::vector<int>::iterator it=MyVector.begin(), end = MyVector.end(); it!= end; ++it)
{
std::cout << "Vector element (*it): " << *it << std::endl;
}
end end() . , , .