title: Can you use a boost::shared_ptr as a key for a map?
body: <p>I may need to rethink my overall design a bit more, but as it stands, it looks like I may want to do something like:</p>
  
  <pre><code>class A; 
  class B;
  std::map&lt;boost::shared_ptr&lt;const A&gt;, B&gt; APtrToBMap;
  </code></pre>
  
  <p>I've tried this, and it does seem to work in a simple case (the compiler didn't complain, and simple tests seem to work). But I'm having second thoughts about this approach. I suspect there are some gotchas in there that I'm not aware of.</p>
  
  <p>So, is the above valid in a practical sense? Or is there some flaw I'm not aware of when I do this?</p>