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
Herb Sutter has a good explanation (around 3:40) https://www.youtube.com/watch?v=JfmTagWcqoE
The main advantage is that the unique pointer keeps track of how many other references there are to that pointer. You only work with the unique pointer when you are working with ownership. When you want to do something with the data with that pointer, you pass the raw pointer.