find_with_equal_func


Description:

[ Version ( since = "2.54" ) ]
public bool find_with_equal_func (G needle, EqualFunc<G>? equal_func, out uint index = null)

Checks whether needle exists in haystack, using the given equal_func.

If the element is found, true is returned and the element’s index is returned in index_ (if non-null). Otherwise, false is returned and index_ is undefined. If needle exists multiple times in haystack, the index of the first instance is returned.

equal_func is called with the element from the array as its first parameter, and needle as its second parameter. If equal_func is null, pointer equality is used.

Parameters:

needle

pointer to look for

equal_func

the function to call for each element, which should return true when the desired element is found; or null to use pointer equality

haystack

pointer array to be searched

index_

return location for the index of the element, if found

Returns:

true if needle is one of the elements of haystack