[Univ of Cambridge] [Dept of Engineering]
next up previous contents
Next: Predicates Up: The Standard Library Previous: Set algorithms

Using member functions

Algorithms can use the member functions of objects they're manipulating.

void print_list(set<Employee*>& s)
{
for_each(s.begin(), s.end(), mem_fun(&Employee::print));
}



Tim Love
2001-07-05