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