[base] Introduce base::Contains
This change introduces base::Contains(), generalizing the existing base::ContainsKey() and base::ContainsValue(). base::Contains() has multiple templated overloads, depending on what API the queried container provides. If possible, it invokes a contains() member function on the passed in container. If this does not work, it will choose a member find() function. If such a function is not present either, it will use std::find() as a fallback. Bug: 970209 Change-Id: I54fb619b6cf229308a40cc81658bd800c3671d40 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1631406Reviewed-by:Daniel Cheng <dcheng@chromium.org> Commit-Queue: Jan Wilken Dörrie <jdoerrie@chromium.org> Cr-Commit-Position: refs/heads/master@{#666228}
Showing
Please register or sign in to comment