std::shared_ptr<T> implicit conversion from T*
can anyone explain to me the rationale for why the constructor of std::shared_ptr that takes a raw pointer as its parameter is marked explicit? it seems much more logical to allow implicit conversion like so:
Code:
std::shared_ptr<T> myPtr = new T();
additionally, there is no assignment operator that accepts a raw pointer.
I don't understand the reasons behind this, as it makes the code somewhat harder to follow, and less natural and convenient to write.