Emmanuel Delahaye said:
But I guess you want a variable list. Il suggest this :
(snip interesting technique)
which is a trick I got here on c.l.c a few years ago. I'm using it day
and night to automate code generation ! Very powerful ! (Perfect to give
a string to an enum, for example...)
That does look like a creative technique, and I'll look for
opportunities to use it. Unfortunately, it doesn't handle the actual
situation I hav; I admit that what I want to do is not a stupendous
idea. The ultimate idea was to allow use of "array literals" (such as
are found in JavaScript) to allow for macros like
if( TEST(int,1,(1,2,3)) ) { /* Checks for second argument in third */
/* ... */
}
None of the other options (inline function, C++ templates, etc.) are
particularly appetizing here either, so it seems that there is no
trick to avoiding tried-and-true (but boring) methods.