title: Why pointer to non-const member function can't point const member function and opposite?
body: <p>What is the reason why pointers to member functions, can't point to const member functions?</p>
  
  <pre><code>struct A {
      void g() {};
      void f() const {}
  };
  </code></pre>
  
  <p>Later in code:</p>
  
  <pre><code>void (A::* fun)() = &amp;A::f;
  </code></pre>
  
  <p>This code produces:</p>
  
  <pre><code>error: cannot convert ‘void (A::*)()const’ to ‘void (A::*)()’ in initialization
  </code></pre>
  
  <p>Of course it compiles with <code>&amp;A::g</code> instead of <code>&amp;A::f</code>.</p>
  
  <p>In opposite situation:</p>
  
  <pre><code>void (A::* fun)() const = &amp;A::g;
  </code></pre>
  
  <p>The error is:</p>
  
  <pre><code>error: cannot convert ‘void (A::*)()’ to ‘void (A::*)()const’ in initialization
  </code></pre>
  
  <p>The second case is rather clear. <code>const</code> pointer isn't expected to modify the object so it can't hold the function which does it. But why it's not possible to assign <code>const</code> member function to <code>non-const</code> member function as in the first case?</p>
  
  <p>It looks like the rule for normal pointers where casting <code>const</code> to <code>non-const</code> would allow to modify the value, but I don't see the point here, where const-correctness is checked in function definition, before such assignment.</p>