title: Parent-Child scheme
body: <p>I'm writing a class that holds a pointer to a parent object of the same type (think Qt's QObject system). Each object has one parent, and the parent should not be destroyed when a child is destroyed (obviously).</p>
  
  <pre><code>class MyClass
  {
  public:
      MyClass(const MyClass* ptr_parent): parent(parent){};
      ~MyClass(){ delete[] a_children; };
  private:
      const MyClass* ptr_parent; // go to MyClass above
      MyClass* a_children; // go to MyClass below
      size_t sz_numChildren; // for iterating over a_children
  }
  </code></pre>
  
  <p>(Excuse my inline coding, it's only for brevity)</p>
  
  <p>Will destroying the "Master MyClass" take care of all children? No child should be able to kill it's parent, because I would then have pointers in my main program to destroyed objects, correct?</p>
  
  <p>Why might you ask? I need a way to "iterate" through all subdirectories and find all files on a platform independent level. The creation of this tree will be handled by native API's, the rest won't. Is this a good idea to start with?</p>
  
  <p>Thanks!</p>