News for hackers. Stuff that matters.
Re:Modern C [pdf] by int_19h on Monday November 28, 2016 @04:56PM (#13058772)
A typical C++ codebase I'm working on these days would have scope guards implemented via macros, such that you can do e.g.:

    FILE* f = fopen(...);
    SCOPE_GUARD({ fclose(f); });
This is mainly used for one-off calls to some native API, where writing a proper RAII wrapper for the managed resource is not worth it.

There are no comments on this comment yet.