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&#x27;t even need the pointer at all since you can simply do:<p><pre><code>  std::unique_ptr&lt;void&gt; finally(42, [](void* unused){ whatever });</code></pre>