On Sat, Jun 10, 2023 at 10:27 AM Frederick Virchanza Gotham via Std-Proposals <std-proposals@lists.isocpp.org> wrote:
Sometimes I have code like this:

void Func(void)
{
    OnScopeExit dummy( [](){ ::close(global_fd); } );

    // Do more stuff here
}

If I later amend this function so that further down there's another
'OnScopeExit', then I have to name the second one "dummy1", and the
third one "dummy2" and so on.

See "The Auto() macro" for a way to do this without dummy names and with less visual noise.
https://quuxplusone.github.io/blog/2018/08/11/the-auto-macro/

–Arthur