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
When I found this, I first wondered why this even compiles. It turns out the shared_ptr
has a special move assignment operator for unique_ptr
objects.
My question is, is this therefore always safe to do, or does it have any implications?
(Safe as for the code execution; it is obviously not safe for a code review...)