In my code, I had ordinary pointer that was dynamically allocated

```
class Texture
{
    //code...
    SDL_Texture* m_texture;
};

```

I had Init() function from Texture class allocated SDL\_Texture\*, and destructor released memory.

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).

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 :

```
//Old code:
m_texture = loadTexture();

//New code:

class Texture
{
   std::shared_ptr<SDL_Texture> m_texture;
};
//code...

m_texture = loadTexture(); // Error! No assignment operator

```

I tried .get() function, but it's rvalue, so I can't assign anything to it. Any ideas?

Thanks in advance.