1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
|
// forward_list::push_front
#include <iostream>
#include <forward_list>
using namespace std;
int main ()
{
forward_list<int> mylist = {77, 2, 16};
mylist.push_front (19);
mylist.push_front (34);
std::cout << "mylist contains:";
for (int& x: mylist) std::cout << ' ' << x;
std::cout << '\n';
return 0;
}
|