Click on fire.cpp to get source.
// File: CExamples/Lists/fire.C
#include "prof.h"
#include <algorithm>
// explicit instantiation of std::find_if
template
list<PROF>::iterator std::find_if(list<PROF>::iterator,
list<PROF>::iterator,
PROF::comp_w_lastname
);
int PROFLIST::fire(const basic_string<char>& badprof)
{// remove element from sorted list;
// return 0 if removal was successful;
iterator p = find_if(begin(), end(), PROF::comp_w_lastname(badprof));
// STL search using (encapsulated) predicate object
// concept demo'd: STL find_if, usage of function object
// Note: lower_bound could be more efficient, as it only
// performs log(size) comparision.
if (p == end()) return 1; // not found
if ((*p).lname != badprof) return 1; // not found
erase(p);
return 0;
} // end PROFLIST::fire