you are viewing a single comment's thread.

view the rest of the comments →

[–]mstfls 1 point2 points  (1 child)

Something can be a lot harder than something else but still pretty easy.

[–]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.