I (erroneously) had the following assignment in my program:
std::shared_ptr<SI::Program> m_program; // in class
m_program = std::make_unique<SI::Program>(); // in method
It is "safe" to do so in a sense that you won't have any double-deleting or other problems.
It is not OK to do so because:
make_uniqueis used to make unique pointers, not shared.
make_uniquewill only allocate the object, not the associated control block. that will force the
shared_ptrconstructor to allocate the control block itself.
std::make_sharedallocate them both in one allocation, which is much more efficient.