title: c++: constructor dependancy between member classes
body: <p>What would be the preferred approach to initializing the following construct?
  The problem with the following example is that in order to initialize <code>renderer_</code> using it's constructor, I need information from the class <code>window_</code>, but the information is only availeable after said class has been initialized, and both instances are initialized concurrently as they are both members of the same class.</p>
  
  <pre><code>class GraphicsManager
  {
  public:
      GraphicsManager(
          const std::string &amp;windowTitle,
          const int &amp;windowWidth,
          const int &amp;windowHeight
          ) : window_(windowTitle,windowWidth,windowHeight),
              renderer_(window_.getHandle()); //IMPOSSIBLE, I presume
  private:
      Window window_;
      Renderer renderer_;
  };
  
  class Window
  {
  public:
      Window() : windowHandle_(NULL);
      Window(const std::string &amp;title, const int &amp;width, const int &amp;height);
      ~Window();
      SDL_Window *getHandle();
  private:
      SDL_Window *windowHandle_;
  };
  
  class Renderer
  {
  public:
      Renderer() : rendererHandle_(NULL);
      Renderer(SDL_Window *WindowHandle);
      ~Renderer();
  private:
      SDL_Renderer *rendererHandle_;
  };
  </code></pre>
  
  <ul>
  <li><p>Not including <code>renderer_</code> in the initialization list of <code>GraphicsManager</code>'s constructor at all, thus implicitly calling <code>renderer_</code>'s default constructor. In the body of <code>GraphicsManager</code>'s constructor I would be assigning a properly initialized <code>Renderer</code> class instance to the empty <code>renderer_</code>. Is this possible to do in the body of the constructor of <code>GraphicsManager</code>?</p>
  
  <pre><code>GraphicsManager(
      const std::string &amp;windowTitle,
      const int &amp;windowWidth,
      const int &amp;windowHeight
      ) : window_(windowTitle,windowWidth,windowHeight)
  {
      //doable? is window_ initialized yet at this point?
      renderer_ = Renderer(window_.getHandle());
  }
  </code></pre></li>
  <li><p>Adding a separate <code>initialize(parameters)</code> method to the affected classes, and
  using them to initialize everything instead of relying on the constructor, but thus also delegating the responsiblity of initializing to the client of the classes?</p></li>
  <li><p>Changing the composition / hierarchy of the classes to something else?</p></li>
  </ul>