1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
|
// list::cbegin/cend
#include <iostream>
#include <list>
int main ()
{
std::list<int> mylist = {5,10,15,20};
std::cout << "mylist contains:";
for (auto it = mylist.cbegin(); it != mylist.cend(); ++it)
std::cout << ' ' << *it;
std::cout << '\n';
return 0;
}
|