title: How to get the pointer to a shared_ptr?
body: <p>I am now hacking an old C code, try to make it more C++/Boost style:</p>
  
  <p>there is a resource allocation function looks like:</p>
  
  <pre><code>my_src_type* src;
  my_src_create(&amp;src, ctx, topic, handle_src_event, NULL, NULL);
  </code></pre>
  
  <p>i try to wrap src by a shared_ptr:</p>
  
  <pre><code>shared_ptr&lt;my_src_type&gt; pSrc;
  </code></pre>
  
  <p>I forgot to mention just now. I need to do this as a loop </p>
  
  <pre><code>std::map&lt;string, shared_ptr&lt;my_src_type&gt;  &gt; dict;
  my_src_type* raw_ptr;
  
  BOOST_FOREACH(std::string topic, all_topics)
  {
      my_src_create(&amp;raw_ptr, ctx, topic, handle_src_event, NULL, NULL);
      boost::shared_ptr&lt;my_src_type&gt; pSrc(raw_ptr);
      dict[topic] = pSrc;
  }
  </code></pre>
  
  <p>Can I do it like this?</p>