title: Delegation and Calling Parent Class Constructors: How do I do both?
body: <p>I was wondering something, regarding delegation of derived class constructors.  What's the proper method for delegating constructors when you also have to call the parent class' constructor?  I know you can't have both delegation and member initialisation in the same initialiser list, but I don't know if calling the parent class' constructor has the same limitation.</p>
  
  <pre><code>// Option 1: Call parent class constructor, then delegate:
  
  class Foo {
      public:
          Foo(int);
  };
  
  class Bar : public Foo {
      public:
          Bar(int, float) : Foo(int), Bar(int, float, 'c');
          Bar(int, float, char);
  };
  
  // Option 2: Delegate, then call parent class constructor:
  
  class Foo {
  public:
      Foo(int);
  };
  
  class Bar : public Foo {
      public:
          Bar(int, float) : Bar(int, float, 'c'), Foo(int);
          Bar(int, float, char);
  };
  
  // Option 3: Primary constructor calls parent class constructor:
  
  class Foo {
      public:
          Foo(int);
  };
  
  class Bar : public Foo {
      public:
          Bar(int, float) : Bar(int, float, 'c');
          Bar(int, float, char) : Foo(int);
  };
  </code></pre>
  
  <p>I would assume it's either #1 or #3 (most likely #3), but I'm not sure; I know it's not a combination, since that would call Foo() twice.  I don't think it's #2, but I listed it just to cover all the possibilities.</p>
  
  <p>I know there's a bit of a weird property to delegation in C++, too, in that the class is considered to be constructed as soon as any of its constructors finishes executing, even if you delegated the call to a different one and it hasn't finished the one that was actually [i]called[/i] yet.  I don't think that would have any effect in this case, but it's worth mentioning.</p>
  
  <p>I searched the site and googled it, but couldn't find an exact answer; the closest I could find was the bit about not having delegation and initialisation in the same init list, on MSDN.  I'm unable to run some test code through a fully C++11-compatible compiler right at the moment, so I couldn't just experiment.  Help would be appreciated.</p>
  
  <p>Thanks in advance.</p>