title: Two phase Construction in C++
body: <p>I have as part of assignment to look into a development kit that uses the "two-phase" construction for C++ classes:</p>
  
  <pre><code>// Include Header
  class someFubar{
  public:
      someFubar();
      bool Construction(void);
      ~someFubar();
  private:
      fooObject _fooObj;
  }
  </code></pre>
  
  <p>In the source</p>
  
  <pre><code>// someFubar.cpp
  someFubar::someFubar : _fooObj(null){ }
  
  bool 
  someFubar::Construction(void){
      bool rv = false;
      this-&gt;_fooObj = new fooObject();
      if (this-&gt;_fooObj != null) rv = true;
      return rv;
  }
  
  someFubar::~someFubar(){
      if (this-&gt;_fooObj != null) delete this-&gt;_fooObj;
  }
  </code></pre>
  
  <p>Why would this "two-phase" be used and what benefits are there? Why not just instantiate the object initialization within the actual constructor?</p>