#ifndef PYTHONIC_BUILTIN_IN_HPP #define PYTHONIC_BUILTIN_IN_HPP #include "pythonic/include/builtins/in.hpp" #include "pythonic/types/traits.hpp" #include PYTHONIC_NS_BEGIN namespace details { template struct in { template bool operator()(T &&t, V const &v) const; }; template <> template bool in::operator()(T &&t, V const &v) const { return std::find(t.begin(), t.end(), v) != t.end(); } template <> template bool in::operator()(T &&t, V const &v) const { return t.contains(v); } } template bool in(T &&t, V const &v) { using RT = typename std::remove_cv::type>::type; static bool constexpr has_contains = types::has_contains::value; return details::in()(std::forward(t), v); } PYTHONIC_NS_END #endif