Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Announce: Macro-Magic (MM), a macro to invoke a macro on up to 21 arguments

11 views
Skip to first unread message

Alf P. Steinbach

unread,
Feb 25, 2017, 8:01:18 AM2/25/17
to
Macro-Magic (MM) is a header-only library with a macro MM_APPLY to
invoke a specified macro on each of up to 21 arguments. There's also
MM_APPLY_WITH_FIXED_ARG to pass a specified fixed first argument to the
invoked macro, and there's MM_NARGS to count the number of arguments
passed to a variadic macro. And MM_CAT to concatenate with expansion.

GitHub repository:
<url: https://github.com/alf-p-steinbach/Macro-Magic/>

This is pretty old code, from at least back in 2013 or perhaps years
earlier than that, based on an original __VA_NARG__ macro by Laurent
Deniau that he posted on 17 January 2006 to [comp.std.c].

<url:
https://groups.google.com/forum/?fromgroups=#!topic/comp.std.c/d-6Mj5Lko_s>

I've modified it to work with Visual C++.

I see now that I posted it on GitHub that I forgot to add a license, but
it's Boost license 1.0.


Cheers, & enjoy!,

- Alf (hoping there are not too many bugs: code like this touches on an
area where compilers are generally not standard-conforming!)
0 new messages