// Demonstrating the STL list sort and unique functions #include #include #include #include using namespace std; template Container make(const char s[]) { return Container(&s[0], &s[strlen(s)]); } int main() { cout << "Demonstrating STL list sort and unique " << "functions." << endl; list list1 = make< list >("Stroustrup"); list1.sort(); assert (list1 == make< list >("Soprrsttuu")); list1.unique(); assert (list1 == make< list >("Soprstu")); cout << " --- Ok." << endl; return 0; }