title: C++ how to pass a boost shared pointer of this instance of class to nested class object?
body: <p>So we have (pseudo code):</p>
  
  <pre><code>class A
  {
   A(shared_ptr parent){}
  }
  
  class B
  {
   A *a;
   B()
   {
    a = new A(boost::shared_ptr(this));
   }
  }
  </code></pre>
  
  <p>Is it possible to do such thing with shared_ptr in C++ and how to do it in real C++ code?</p>