I’m writing a render, there is a class that shaders should store, something like a shader manager. These shaders are stored as
std :: map <std :: string, std :: shared_ptr <BaseShader>> cache;
BaseShader is an abstract class (there are virtual methods).
Other classes want to own shaders, and request them accordingly by name. That is, they each have a copy of the smart pointer. After the change, the shaders need to be rebooted from the disk. Accordingly, new is done and written by name in the cache, the problem is that clients do not see this change. How to make sure that the reset for the smart pointer is not made, and the updated object was copied to the same address that it stores?