Code Fragment: STLiterator



using namespace std;                                      // make std available
template <typename Object>
void print(list<Object>& L) {			          // print an STL list
  list<Object>::iterator iter = L.begin(); 	          // vector iterator
  while (iter != L.end()) {				  // while more remain
    cout << *iter << " ";				  // print next
    ++iter;						  // advance
  }
}