Use std::unique_ptr when only one reference to some object exists (or is allowed to exist) simultaneously.
Use std::shared_ptr when multiple references exist (or are allowed to exist) simultaneously.
That's pretty much it.
Most/all of our containers (like vectors) now contain std::shared_ptr, which means that you must update all code from e.g. std::vector<hdi::core::Art*> to std::vector<std::shared_ptr<hdi::core::Art>>
Beyond that, you won't necessarily notice many differences in most cases. The advantages here are big - std::unique_ptr "compilationally" enforces only one reference to exist; containers of std::shared_ptr do not need to be manually emptied/cleaned up to ensure no memory leaks.
Use std::shared_ptr when multiple references exist (or are allowed to exist) simultaneously.
That's pretty much it.
Most/all of our containers (like vectors) now contain std::shared_ptr, which means that you must update all code from e.g. std::vector<hdi::core::Art*> to std::vector<std::shared_ptr<hdi::core::Art>>
Beyond that, you won't necessarily notice many differences in most cases. The advantages here are big - std::unique_ptr "compilationally" enforces only one reference to exist; containers of std::shared_ptr do not need to be manually emptied/cleaned up to ensure no memory leaks.