Article ID: 158086 - Last Review: January 9, 2006 - Revision: 5.1 How to use the list::back, list::front, list::pop_back, list::pop_front, list::push_back, and list::push_front STL functions in Visual C++This article was previously published under Q158086 On This PageSUMMARY The sample code below illustrates how to use the
list::back, list::front, list::pop_back, list::pop_front, list::push_back, and
list::push_front STL functions in Visual C++. MORE INFORMATIONRequired headerPrototypeDescriptionThe member function back returns a reference to the last element of the controlled sequence. The member function front returns a reference to the first element of the controlled sequence. The member function pop_back removes the last element of the controlled sequence. The member function pop_front removes the first element of the controlled sequence. All the above functions require that the controlled sequence be non-empty.The member function push_back inserts an element with value x at the end of the controlled sequence. The member function push_front inserts an element with value x at the beginning of the controlled sequence. Sample codefront back middle REFERENCES For more information about list::back and list::front,
visit the following Microsoft Developer Network (MSDN) Web site: http://msdn.microsoft.com/en-us/library/8bb5581w.aspx
(http://msdn.microsoft.com/en-us/library/8bb5581w.aspx)
APPLIES TO
| Article Translations
|
Back to the top
