The function is meant to filter out members that don't meet the filter criteria using a function.
It should pass the current member entity to the filter function and not the entity in the function argument list.
There's currently only one place in the code where the function is used with a filter. In UnitAI, it uses the "CanAttack" function to filter out entities that can't be attacked.
It filters out all entities there because it checks if an entity can attack itself rather than checking if the entity can attack the member of the enemy formation.
I've discovered this when I was experimenting with formations in my git branch. I'm unsure what the impact in SVN currently is.
In SVN we disband the formation when attacking and rarely/never attack a formation controller entity. The code might only be used if "CanAttackAsFormation" is true in the FormationAttack component. It's currently set to false for all formations.