check if all elements satisfy the condition
This function is supposed to be used on a small amount of objects, typically tags of the same alignment. Therefore it runs in O(N^2) but doesn't require any memory allocations.
check if any element satisfies the condition
begFunc and endFunc must take a reference to the object and return references to the field. FIXME: the design is ugly.