On 12/15/25 7:53 AM, Marco Elver wrote:
For cleanup.h, the problem is that to instantiate we use "guard(class)(args..)". If it had been designed as "guard(class, args...)", i.e. just use __VA_ARGS__ explicitly instead of the implicit 'args...', it might have been possible to add a second cleanup variable to do the same (with some additional magic to extract the first arg if one exists). Unfortunately, the use of the current guard()() idiom has become so pervasive that this is a bigger refactor. I'm going to leave cleanup.h as-is for now, if we think we want to give this a go in the current state.
Peter, has it already been considered to make the guard() and scoped_guard() macros more consistent? If there would be agreement that guard(class)(args..) should be changed into guard(class, args..), I can help with realizing this conversion. Thanks, Bart.
