title: How to initialize a shared pointer in the initialization list of a constructor?
body: <p>How can I initialize a shared pointer in the initialization list of a constructor?</p>
  
  <p>I have this:</p>
  
  <pre><code>Foo::Foo (const callback &amp;cb)
  {
      Bar bar;
      bar.m_callback = cb;
      m_ptr = std::make_shared&lt;Bar&gt;(bar);
  
      //...
  }
  </code></pre>
  
  <p>I would like to put this into the initializer list of the contructor.
  Something like:</p>
  
  <pre><code>Foo::Foo (const callback &amp;cb) :
     m_ptr(std::make_shared&lt;Bar&gt;(?????))
  {
    // ...
  }
  </code></pre>
  
  <p>Bar is a <code>struct</code>:</p>
  
  <pre><code>struct Bar
  {
    callback_type m_callback;
    // etc.
  };
  </code></pre>