The section 7.12.4 ‘Iterator index querying’ provides an example as shown below:
typedef struct {int index; ...} idx_type; idx_type q[$]; ... // Find items with index values not matching their position in the queue q = arr.find(item, iter_index) with (item.index != item.iter_index);
Here shouldn’t array locator ‘find’ method be applied to ‘q’ instead of ‘arr’?
No, find is being used as a method of the arr associative array. The data type of the associative array elements is irrelevant here. q is a queue of arr’s index type that will store the result of the find method.