title: Is there a way to prevent a base class method from being called on an instance of a derived class?
body: <p>I have a base class with a bunch of functionality and a derived class that extends that class but there are a few methods in the base class that don't make sense on the derived class.</p>
  
  <p>Is it possible to do something to prevent these method(s) from being used by the derived class?</p>
  
  <pre><code>Class A
  {
     ...
  
     public:
        void SharedMethod();
        virtual void OnlyMakesSenseOnA();
  }
  
  Class B : public Class A
  {
     ...
  
     public:
        void OnlyMakesSenseOnB();
  }
  </code></pre>
  
  <p>The following obviously doesn't work but is it possible to do something similar so that the compiler doesn't allow a certain base class method to be called?</p>
  
  <pre><code>Class B : public Class A
  {
     ...
  
     public:
        void OnlyMakesSenseOnA() = 0;
  }
  </code></pre>