Simple Contains() Function
Nice toy! Took me a while to wrap my head around it. It looks ok. The only thing I was thinking about is why not to use std::enable_if as it is much simpler.

#include &lt;iostream&gt;
#include &lt;algorithm&gt;
#include &lt;utility&gt;
#include &lt;map&gt;
#include &lt;set&gt;
#include &lt;vector&gt;
#include &lt;array&gt;
#include &lt;type_traits&gt;

// Detect if container has C::find
template &lt;typename C&gt; decltype(std::declval&lt;C&gt;().find(0), std::true_type{}) test(int);
template &lt;typename C&gt; std::false_type test(...);
template &lt;typename C&gt; using has_find = decltype(test&lt;C&gt;(0));

template &lt;typename C, typename T&gt;
typename std::enable_if&lt;has_find&lt;C&gt;::value, bool&gt;::type contains(const C&amp; container, const T&amp; key) {
    return c.end() != c.find(k);
}

template &lt;typename C, typename T&gt;
typename std::enable_if&lt;!has_find&lt;C&gt;::value, bool&gt;::type contains(const C&amp; container, const T&amp; key) {
    return c.end() != std::find(c.begin(), c.end(), k);
}

int main()
{
    /* */
}