3 ms·
Because it doesn't have to be something you'd ordinarily think of as a "destructor". e.g. you might have multiple possible functions that consume the value, bec
by _dain_ 3y ago
Because it doesn't have to be something you'd ordinarily think of as a "destructor". e.g. you might have multiple possible functions that consume the value, because you're modelling a state machine with several outgoing edges from the type-state. You get to choose the one you call.
- throwup238 3y ago`defer` allows for executing arbitrary expressions based on scope (the "destructor" called depends on the code path)