title: static_assert : a certain function in Derive "must" hides Base's class function
body: <p>I face a strange rare problem that I want to hide a Base class's function <code>B::f1(int)</code>.     </p>
  
  <pre><code>class B{
      public: void f1(int){}
      public: void f1(float){}
  };
  class C : public B{
      public: void f1(int){
          //static_assert(ASSERT_that_thisFunctionHidParentFunction,"");
          //some rare ugly hacky stuff
      }
      public: void f1(char){
          //static_assert(!ASSERT_that_thisFunctionHidParentFunction,"");
      }
  };
  </code></pre>
  
  <p>Everything works fine ; I just worry about maintainability.<br>
  I wish to make sure that a function <code>C::f1(int)</code> always hides <code>B::f1(int)</code>.    </p>
  
  <p>If <code>B::f1(int)</code> happen to change signature in the future (e.g. to <code>B::f1(int,int)</code>),<br>
   I want some compile error to notify programmers that <code>C::f1(int)</code> should be changed to <code>C::f1(int,int)</code> as well.</p>
  
  <p>In real world, my problematic function <code>f1</code> doesn't have overload.<br>
  But for educational purpose, I wish to know how to solve it if there are overload too.  (i.e. optional)    </p>
  
  <p>I love a cute solution like <code>ASSERT_that_thisFunctionHidParentFunction</code> in my code comment.<br>
  I don't mind MACRO.     </p>
  
  <h2>My poor solution</h2>
  
  <p>I tried to typedef to force compile error, but it doesn't assert-fail in some case (<a href="http://coliru.stacked-crooked.com/a/ff7470bc2428de56" rel="nofollow noreferrer">MCVE-coliru</a>), because <code>int</code> is automatically casted to <code>B::f1(float)</code>.</p>
  
  <pre><code>class B{
      public: void f1(int,int){}
      public: void f1(float){}
  };
  class C : public B{
      public: void f1(int){
          using XXX=decltype(std::declval&lt;B&gt;().f1(std::declval&lt;int&gt;()));
          //static_assert(ASSERT_that_thisFunctionHidParentFunction,"");
      }
      public: void f1(char){
          //static_assert(!ASSERT_that_thisFunctionHidParentFunction,"");
      }
  };
  int main() {
     return 0;
  }
  </code></pre>