Saturday, November 12, 2016

defer to C

It turns out that deferring statements to scope exit, as recently popularized by Go; is perfectly doable in C. c4life supports two flavors of defer, both based on cleanup __attributes__; one for current scope and a more elaborate version for deferring to user defined scopes.