-
Notifications
You must be signed in to change notification settings - Fork 328
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
in array.c array_contains() doesn't work #28
Comments
Technically it works, because comparing the pointer values was the original idea, but now that you mention it it may not be the most obvious. or the most useful thing to do. So yes, a comparator function should be included. |
Couldn't you just dereference the pointers and compare the values? What is the benefit of passing a comparator function? :) |
@faviouz It's not allowed to dereference a |
Ah, of course! :) |
Looks very similar to #18, right? |
@f2404 yes indeed |
I've added a contains variant that takes a comparison function. One should now be able to search for the actual values pointed to by the container elements. |
in array.c you are comparing only the addresses not the actual data, you need a comparison function as argument to
array_contains
@srdja
The text was updated successfully, but these errors were encountered: