This function checks whether container contains given key. Use container specific .contains() implementation if available, otherwise uses .find() implementation.
Declared in <folly/container/CollectionUtil.h>
template<
class C,
class K = C::key_type>
requires (detail::HasContains<C, K> || detail::HasFind<C, K>)
bool
contains(
C const& container,
K const& key);
true if the container contains the key, false otherwise.
| Name | Description |
|---|---|
| container | The container to search. |
| key | The key to look for. |