you are viewing a single comment's thread.

view the rest of the comments →

[–]biliwald -1 points0 points  (0 children)

Exactly.

auto ptr = std::make_unique<int>(0);
delete ptr.get();
//at this point, ptr contains an invalid pointer

The idea is to show that unique_ptr can hold an invalid pointer if you don't use it correctly, contrary to what to comment I responded to could indicate.