title: Why doesn't the C++ default destructor destroy my objects?
body: <p>The C++ specification says the default destructor deletes all non-static members. Nevertheless, I can't manage to achieve that.</p>
  
  <p>I have this:</p>
  
  <pre><code>class N {
  public:
      ~N() {
          std::cout &lt;&lt; "Destroying object of type N";
      }
  };
  
  class M {
  public:
      M() {
          n = new N;
      }
  //  ~M() { //this should happen by default
  //      delete n;
  //  }
  private:
      N* n;
  };
  </code></pre>
  
  <p>Then this should print the given message, but it doesn't:</p>
  
  <pre><code>M* m = new M();
  delete m; //this should invoke the default destructor
  </code></pre>