title: Proper way to make base class setup parent class
body: <p>I'm struggling a bit with the following situation: Lets say I have a class "Base" which requires some information in order to work properly. Therefore, I've set up a single constructor with the appropriate parameters, e.g.:</p>
  
  <pre><code>class Base {
      public: Base(X x, Y y, Z z);
  };
  </code></pre>
  
  <p>This works fine for general "bases". But I'd like to have subclasses that represent specific "bases" which are often used and which contain all information required to setup the base class, e.g.:</p>
  
  <pre><code>class Derived {
      public: Derived() {
          X x;
          x.addSomeInformation("foo bar");
          // ...
          // now what?
      }
  };
  </code></pre>
  
  <p>Problem here is that I cannot invoke the parent constructor via the initializer list (as one would usually do) becaues the parameters to be handed over do not yet exist.</p>
  
  <p>Due to this, I feel that something is seriously wrong with my design. I can make this work by introducing a protected default constructor and a "configure" method that imitates the normal constructor, but I'm not sure if this is a good idea (mainly because this way I cannot ensure that the subclass actually invokes "configure" - and if it doesn't that would leave me with a not properly initialized base class):</p>
  
  <pre><code>class Base {
      public: Base(X x, Y y, Z z) { configure(x, y, z); }
      protected: Base() {}
      protected: void configure(X x, Y y, Z z);
  };
  
  class Derived {
      public: Derived() {
          X x;
          // ...
          configure(x, y, z);
      }
  };
  </code></pre>
  
  <p>How would one deal with such a situation in a proper way?</p>