Alexandrescu at CPPCon2015 describes how he does ScopeExit starting at 18 minutes into this video<p><a href="http:&#x2F;&#x2F;youtu.be&#x2F;WjTrfoiB0MQ" rel="nofollow">http:&#x2F;&#x2F;youtu.be&#x2F;WjTrfoiB0MQ</a>