Discussion about this post

User's avatar
jwcs's avatar

Nice try, but [STC](https://github.com/stclib/STC) 's defer/with/scope is possibly the most beautiful, and simplest, implementation I've ever seen.

[Docs](https://github.com/stclib/STC/blob/master/docs/algorithm_api.md#raii-scope-macros)

[Src](https://github.com/stclib/STC/blob/master/include/stc/common.h)

``` c

#define c_defer(...) \

for (int _i = 1; _i; _i = 0, __VA_ARGS__)

// see also c_with, c_scope, with ideal semantics and similar impl

```

Expand full comment
1 more comment...

No posts