Parameters
noneReturn value
noneExample
| 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 |
|
Output:
mylist contains: 100 200 300 mylist contains: 1101 2202 |
Complexity
Linear on size (destructors).See also
| list::erase | Erase elements (public member function) |
| list::resize | Change size (public member function) |
| list::pop_back | Delete last element (public member function) |
| list::pop_front | Delete first element (public member function) |
| list::remove | Remove elements with specific value (public member function) |
| list::unique | Remove duplicate values (member function) |
| list::empty | Test whether container is empty (public member function) |
