// Illustrating the generic lexicographical_compare algorithm #include #include #include #include using namespace std; template Container make(const char s[]) { return Container(&s[0], &s[strlen(s)]); } int main() { cout << "Illustrating the generic" << " lexicographical_compare algorithm." << endl; vector vector1 = make< vector >("helio"); vector vector2 = make< vector >("hello"); // Show that vector1 is lexicographically // less than vector2: bool result = lexicographical_compare(vector1.begin(), vector1.end(), vector2.begin(), vector2.end()); assert (result == true); cout << " --- Ok." << endl; return 0; }