title: In C++ inheritance, how can the derived class disable some elements (data or functions) of the base class?
body: <p>For example, suppose now we have two classes, Tree (base class) and BinaryTree (derived class). The class Tree have the data children and function getChildren().</p>
  
  <pre><code>class Tree {
  public:
      vector&lt;int&gt; getChildren();
      ...
  private:
      vector&lt;int&gt; children;
      ...
  };
  </code></pre>
  
  <p>And the derived class have the data leftChild and rightChild, and functions of getLeftChild() and getRightChild().</p>
  
  <pre><code>class BinaryTree : public Tree {
  public:
      int getLeftChild();
      int getRightChild();
      ...
  private:
      int leftChild;
      int rightChild;
      ...
  };
  </code></pre>
  
  <p>Definitely, the data children and function getChildren() is not what we want in the derived class. We may simply don't use them but they still exist. So how to disable these elements in the derived class?</p>
  
  <p>Thanks</p>