// Demonstrating the generic find algorithm with a deque #include #include #include #include // For find using namespace std; template Container make(const char s[]) { return Container(&s[0], &s[strlen(s)]); } int main() { cout << "Demonstrating generic find algorithm with " << "a deque." << endl; deque deque1 = make< deque >("C++ is a better C"); // Search for the first occurrence of the letter e: deque::iterator where = find(deque1.begin(), deque1.end(), 'e'); assert (*where == 'e' && *(where + 1) == 't'); cout << " --- Ok." << endl; return 0; }