Doesn\'t std::unique_ptr::get defeat the purpose of having a unique_ptr in the first place?
I would have expected this function to change its state so it holds
When your hands are tied and you do need to pass a pointer to something, p.get() reads better than &*p.
There is a function that changes the state so the unique_ptr doesn't hold a pointer anymore, and that one is named release. This is mostly useful to transfer ownership to other smart pointers that don't provide direct construction from a unique_ptr. Any other use risks leaking the resource.