title: Detecting overloaded method from parent class
body: <p>I have been using this utility below to detect if a member method has been defined in a class, which works in most of the cases in my framework.</p>
  <pre><code>template &lt;typename C, typename TInput&gt;
  class HasHandle
  {
      template &lt;class T&gt;
      static std::true_type testSignature(void(T::*)(const TInput&amp;));
  
      template &lt;class T&gt;
      static decltype(testSignature(&amp;T::HandleEvent)) test(std::nullptr_t);
  
      template &lt;class T&gt;
      static std::false_type                          test(...);
  
  public:
      using type = decltype(test&lt;C&gt;(nullptr));
      static constexpr bool value = type::value;
  };
  </code></pre>
  <p>But the problem happens when I try to move some shared <code>EventHandle</code> into the base class, so I can share the same event handling logic in multiple classes.</p>
  <p>After moving some <code>EventHandle</code> into the base class and uses <code>using EventHandle</code> to make the base class method visible, I noticed <code>HasHandle</code> will fail to detect the <code>EventHandle</code> I defined in the base class.</p>
  <p>Here is a quick example:</p>
  <pre><code>struct ShareEventHandler
  {
      void HandleEvent(const int&amp;) {}
  };
  
  struct Foo : public ShareEventHandler
  {
      using ShareEventHandler::HandleEvent;
      void HandleEvent(const Foo&amp;) {}
  };
  
  static_assert(HasHandle&lt;Foo, Foo&gt;::value, &quot;failed to detect the method&quot;);
  static_assert(HasHandle&lt;Foo, int&gt;::value, &quot;failed to detect the method&quot;); // this will fail
  
  </code></pre>
  <p>Does anyone have an idea about how to improve <code>HasHandle</code> to resolve the failed static_assert above?</p>
  <hr />
  <p>Update :
  I am using Microsoft Visual Studio Community 2019 Version 16.8.1, according to the comment, the issue can't be reproduced on g++ 8.3.0 and clang++ 7.0.1
  Here is a link for the compile test.
  <a href="https://gcc.godbolt.org/z/1x9n3Y" rel="nofollow noreferrer">https://gcc.godbolt.org/z/1x9n3Y</a></p>