title: Assigning std::shared_ptr
body: <p>In my code, I had ordinary pointer that was dynamically allocated</p>
  
  <pre><code>class Texture
  {
      //code...
      SDL_Texture* m_texture;
  };
  </code></pre>
  
  <p>I had Init() function from Texture class allocated SDL_Texture*, and destructor released memory.</p>
  
  <p>However, this turned out to be a problem. I had to use shared_ptr, because I was using same texture for different objects, which would be destroyed, and thus disallowing me to display them properly(after first object from vector is destroyed, the texture(which is shared for all objects of same type) is gone).</p>
  
  <p>So I decided to use shared_ptr, but I have one problem with it - I don't know how to assign something to shared_ptr's :</p>
  
  <pre><code>//Old code:
  m_texture = loadTexture();
  
  //New code:
  
  class Texture
  {
     std::shared_ptr&lt;SDL_Texture&gt; m_texture;
  };
  //code...
  
  m_texture = loadTexture(); // Error! No assignment operator
  </code></pre>
  
  <p>I tried .get() function, but it's rvalue, so I can't assign anything to it. Any ideas?</p>
  
  <p>Thanks in advance.</p>