// Demonstrating generic reverse algorithm on a list #include #include #include #include // For reverse using namespace std; template Container make(const char s[]) { return Container(&s[0], &s[strlen(s)]); } int main() { cout << "Demonstrating generic reverse algorithm on a list" << endl; list list1 = make< list >("mark twain"); reverse(list1.begin(), list1.end()); assert (list1 == make< list >("niawt kram")); cout << " --- Ok." << endl; return 0; }