// liststck.cpp
// compile with: /EHsc
// This example shows how to use the various stack
// like functions of list.
//
// Functions:
// list::back
// list::front
// list::pop_back
// list::pop_front
// list::push_back
// list::push_front
#pragma warning (disable:4786)
#include <list>
#include <string>
#include <iostream>
using namespace std ;
typedef list<string> LISTSTR;
int main()
{
LISTSTR test;
test.push_back("back");
test.push_front("middle");
test.push_front("front");
// front
cout << test.front() << endl;
// back
cout << test.back() << endl;
test.pop_front();
test.pop_back();
// middle
cout << test.front() << endl;
}