title: delete right child makes parent left pointer point to nullptr
body: <p>thank you for checking my question, I currently have a really basic question on operator "delete", it seems it can automatically change the pointer value to nullptr. Let me give you a example for this:</p>
  
  <pre><code>    template &lt;typename T&gt;
      void Tree&lt;T&gt;::remove(const unsigned&amp; index, TreeNode&lt;T&gt;*&amp; tree)
      {
          if(tree == nullptr)
          {
              std::cerr &lt;&lt; "remove: can't find target" &lt;&lt; std::endl;
          }
          else if(index &lt; tree-&gt;index)
          {
              remove(index, tree-&gt;left);
          }
          else if(index &gt; tree-&gt;index)
          {
              remove(index, tree-&gt;right);
          }
          else if(index == tree-&gt;index)
          {
              if(tree-&gt;degree() == 2)
              {
                  tree-&gt;index = findMin(tree-&gt;right)-&gt;index;
                  tree-&gt;value = findMin(tree-&gt;right)-&gt;value;
                  remove(tree-&gt;index, tree-&gt;right);
              }
              else
              {
                  auto oldNode = tree;
                  tree = (tree-&gt;left != nullptr) ? tree-&gt;left: tree-&gt;right;
                  delete oldNode;
      //          oldNode = nullptr;
  
              }
          }
      }
  </code></pre>
  
  <p>The code above is a classic searching tree remove algorithm. If the current tree only has two nodes which is root (with key equals to 3 for example) and right child (with key equals to 4 for example), so when I remove node 4, it will call remove twice and go to this line:</p>
  
  <pre><code>    delete oldNode;
  </code></pre>
  
  <p>And this line will delete "oldNode", which should be 4 right now. As far as my knowledge, the delete operator will just free the memory address(the address is same to the value of oldNode), which means it tells OS this address is available again. So I suppose when I print out the value of root's right pointer(root->right), I should get a address. Actually when I print out I get 0. So my question when root->right changed?</p>
  
  <p>Hope I explain my question clearly. That may be a stupid question, let me known if I make any confusion.</p>