/* -*- C++ -*- */ /************************************************************************* * Copyright(c) 1995~2005 Masaharu Goto (root-cint@cern.ch) * * For the licensing terms see the file COPYING * ************************************************************************/ #include #include #include #include #include using namespace std; int main() { cout << "Demonstrating generic find algorithm with " << "a vector." << endl; char * s = "C++ is a better C"; int len = strlen(s); cout << "instantiate vector" << endl; // vector1 initialization #if !(G__GNUC>=3) vector vector1(&s[0] , &s[len]); #else vector vector1; for(int i=0;i::iterator where = find(vector1.begin(),vector1.end(), 'e'); assert(*where == 'e' && *(where+1)=='t'); cout << *where << *(where+1) << endl; }