• jdoerrie's avatar
    [base] Introduce base::Contains · b77149f3
    jdoerrie authored
    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: default avatarDaniel Cheng <dcheng@chromium.org>
    Commit-Queue: Jan Wilken Dörrie <jdoerrie@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#666228}
    b77149f3
platform_thread_win_unittest.cc 4.81 KB