I think you could just create a (static) method bool canLockOn(worldObject*) and use it for find_if.