//Excerpt from visionary.C. class not_enemy_of { const wabbit *const w; const unsigned radius; public: not_enemy_of(const wabbit *initial_w, unsigned initial_radius) : w(initial_w), radius(initial_radius) {} //Return true if the other wabbit is not a nearby enemy of wabbit w. bool operator()(const wabbit *other) const { return other == w || //No animal is its own enemy. other->hungry() <= w->bitter() || distance(w, other) > radius; } };