title: has_equal_operator implementation in C++11
body: <p>I am trying to implement <code>has_equal_operator</code> in C++11 and so far came up with following solution. It works for simple cases like <code>int</code> or <code>struct A{}</code> but fails (returning false positive) for <code>std::vector&lt;A&gt;</code>. Why is it failing and how to fix this?</p>
  
  <pre><code>#include &lt;vector&gt;
  #include &lt;iostream&gt;
  
  template&lt;typename T&gt;
  constexpr auto has_equal_operator(int) -&gt; decltype(std::declval&lt;T&gt;() == std::declval&lt;T&gt;(), bool()) { return true; }
  template&lt;typename T&gt;
  constexpr bool has_equal_operator(...) { return false; }
  
  struct A {};
  
  void test()
  {
      std::cout &lt;&lt; "has_equal_operator&lt;int&gt;: " &lt;&lt; has_equal_operator&lt;int&gt;(0) &lt;&lt; std::endl;
      std::cout &lt;&lt; "has_equal_operator&lt;A&gt;:   " &lt;&lt; has_equal_operator&lt; A &gt;(0) &lt;&lt; std::endl;
      std::cout &lt;&lt; "has_equal_operator&lt;std::vector&lt;A&gt;&gt;:   " &lt;&lt; has_equal_operator&lt; std::vector&lt;A&gt; &gt;(0) &lt;&lt; std::endl;
  }
  </code></pre>
  
  <p>Output:</p>
  
  <pre><code>has_equal_operator&lt;int&gt;: 1
  has_equal_operator&lt;A&gt;:   0
  has_equal_operator&lt;std::vector&lt;A&gt;&gt;: 1
  </code></pre>