title: New to c++11 features, proper use of shared_ptr?
body: <p>So my understanding is that a shared_ptr automatically deallocates from memory when the last remaining owner of the object is destroyed or reassigned, (Seems too good to be true?) and it's useful when many instances may be sharing the same object. Correct?</p>
  
  <p>So in my case, I'm making a 2d tiled world, so I'm drawing many of the same texture to the screen.</p>
  
  <p>I have</p>
  
  <pre><code>std::map&lt;int, shared_ptr&lt;Tile&gt;&gt; Tiledb;
  </code></pre>
  
  <p>to store all the tiles. The idea is to only load the texture in once and then i can render it as many times as I want. Then once the game ends I call</p>
  
  <pre><code>Tiledb.clear();
  </code></pre>
  
  <p>And this frees all the memory automatically? I'm so conditioned to regular pointers that this just seems magical, and quite frankly, too easy. Am I wrong in thinking this is how it works? Is there any downside to using shared_ptrs? I'm just amazed that this exists haha. </p>
  
  <p>Thanks for any information. </p>