Introduction to OOP Chapter 20: The STL : next previous audio real text

Function Objects

Created like an instance of a class, works like a function.

class WidgetTester {
public:
	WidgetTester (int id) : test_id(id) { }
	int test_id;

		// define the function call operator
	bool operator () (Widget & wid)
		{ return wid.id() == test_id; }
};
Intro OOP, Chapter 20, Slide 14