Isn't std::unique_ptr
designed to be an unique pointer to a memory, and no other pointer should point to this memory ?
Then why does std:unique_ptr
has a get()
member function which returns a raw pointer to the memory owned by the std::unique_ptr
?
So by using get()
we can create numerous owners ( raw pointers ) to the std::unique_ptr
's memory, isn't that senseless ?