#include
#include
#include
#include
#include
using namespace std;
int main()
{
vector vectorObject;
vector::iterator p;
int i;
vectorObject.push_back("One");
vectorObject.push_back("Two");
vectorObject.push_back("Three");
vectorObject.push_back("Four");
vectorObject.push_back("Five");
cout << "Sequence contains:";
for(i = 0; i cout << vectorObject[ i ] << " ";
cout << endl;
cout << "Searching sequence for Three.\n";
// use a pointer-to-function adaptor
p = find_if(vectorObject.begin(), vectorObject.end(), not1(bind2nd(ptr_fun(strcmp), "Three")));
if(p != vectorObject.end()) {
cout << "Found.";
cout << "Sequence from that point is:";
do {
cout << *p++ << " ";
} while (p != vectorObject.end());
}
return 0;
}