Vuo  1.2.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Macros

Description

Macro to emulate Go's (and Swift's) defer keyword.

Macros

#define VuoDefer
 Defers execution of the specified block until the end of scope.
 

Macro Definition Documentation

#define VuoDefer

Defers execution of the specified block until the end of scope.

Example:
FILE *a = fopen("a.txt", "r");
if (!a)
return;
VuoDefer ^{ fclose(a); };

See also http://fdiv.net/2015/10/08/emulating-defer-c-clang-or-gccblocks