Comment
Comment by thrownaway2424
This is one of my favorite features of unique_ptr. It is an all-purpose way to make something happen at the end of scope without having to write a new struct and destructor. You don't even need the pointer at all since you can simply do: