Container-Beispiel

template<class T>
void show (list<T> l) {
   for ( list<T>::iterator it = l.begin () ;
        it != l.end () ; ++it )
    {
      cout << *it << endl;
    }
}
int main (int argc, char ** argv) {
  list<string> l;
  for ( string s ; cin >> s ; ) {
    l.push_back (s);
  }
  l.show; l.sort (); l.show;
}



Johannes Waldmann 2004-11-30