This post explores some unexpected usages of Zig's defer statement, including asserting post conditions, statically enforcing absence of errors, logging errors, and using defer as a post increment operation.
Table of contents
Asserting Post ConditionsStatically Enforcing Absence of ErrorsLogging ErrorsPost IncrementSort: