#ifndef CORE_FXCRT_CONTAINERS_CONTAINS_H_
#define CORE_FXCRT_CONTAINERS_CONTAINS_H_
#include <algorithm>
#include <iterator>
#include <type_traits>
#include "core/fxcrt/template_util.h"
namespace pdfium {
namespace internal {
template <typename T, typename SFINAE = void>
struct HasKeyType : std::false_type { … };
HasKeyType<T, std::void_t<typename T::key_type>>;
template <typename Container, typename Element, typename = void>
struct HasFindWithNpos : std::false_type { … };
HasFindWithNpos<Container, Element, std::void_t<decltype(std::declval<const Container &>().find(std::declval<const Element &>()) != Container::npos)>>;
template <typename Container, typename Element, typename = void>
struct HasFindWithEnd : std::false_type { … };
HasFindWithEnd<Container, Element, std::void_t<decltype(std::declval<const Container &>().find(std::declval<const Element &>()) != std::declval<const Container &>().end())>>;
template <typename Container, typename Element, typename = void>
struct HasContains : std::false_type { … };
HasContains<Container, Element, std::void_t<decltype(std::declval<const Container &>().contains(std::declval<const Element &>()))>>;
}
template <typename Container,
typename Value,
std::enable_if_t<
!internal::HasFindWithNpos<Container, Value>::value &&
!internal::HasFindWithEnd<Container, Value>::value &&
!internal::HasContains<Container, Value>::value>* = nullptr>
bool Contains(const Container& container, const Value& value) { … }
template <typename Container,
typename Value,
std::enable_if_t<internal::HasFindWithNpos<Container, Value>::value &&
!internal::HasContains<Container, Value>::value>* =
nullptr>
bool Contains(const Container& container, const Value& value) { … }
template <typename Container,
typename Value,
std::enable_if_t<internal::HasFindWithEnd<Container, Value>::value &&
!internal::HasContains<Container, Value>::value>* =
nullptr>
bool Contains(const Container& container, const Value& value) { … }
template <
typename Container,
typename Value,
std::enable_if_t<internal::HasContains<Container, Value>::value>* = nullptr>
bool Contains(const Container& container, const Value& value) { … }
}
#endif