title: Initialize a reference - warning C4355: 'this' : used in base member initializer list
body: <pre><code>class A;
  
  class B {
  public:
      B(A&amp; a) : a(a) {}
  private:
      A&amp; a;
  };
  
  /* Method 1 */
  /* warning C4355: 'this' : used in base member initializer list */
  /*
  class A {
  public:
      A() : b(*this) {}
  
  private:
      B b;
  };
  */
  
  /* Method 2 */
  /* But I need to manually perform memory dellocation. */
  class A {
  public:
      A() { b = new B(*this); }
      ~A() { delete b; }
  
  private:
      B* b;
  };
  
  int main() {
  }
  </code></pre>
  
  <p>Currently, when I try to initialize the reference in B, I am using Method 1. However, Method 1 will flag me warning which is understandable.</p>
  
  <p>Hence, I have to fall back using Method 2, by using dynamic memory allocation.</p>
  
  <p>Is there any better way I can use, without the need of manual memory allocation/ dellocation (OK. I know smart pointer)?</p>
  
  <p>I prefer Method 1, just that I am not comfortable with the warning.</p>