// Example program : maximum of a std::list #include // for cout #include "max-list.h" using namespace std; int main(){ static double foo_set[] = {1.11, 5.55, 2.22, 4.44}; list foo(foo_set, foo_set + sizeof(foo_set) / sizeof(foo_set[0])); foo.push_back(3.33); // tack on another element cout << "The max of foo is: " << max(foo) << endl; list bar; cout << "The max of bar is: " << max(bar) << endl; // Nothing from here on will get executed, // because we don't catch the exception. cout << "won't get here" << endl; }