C
claus.tondering
I need to write a macro that inserts
someStruct m_someStruct;
into another struct declaration.
The problem is that if the programmer specifies one particluar struct
(called alpha), nothing should be inserted.
So, is it possible to write a macro that does this:
MACRO(alpha) expands to nothing
MACRO(X) expands to X m_##X (for all values of X except alpha)
My guess is that it is impossible. But then, in the Boost preprocessor
package, they achieve some things that I would also have thought
impossible.
This has to work in C, so I cannot use C++ templates.
someStruct m_someStruct;
into another struct declaration.
The problem is that if the programmer specifies one particluar struct
(called alpha), nothing should be inserted.
So, is it possible to write a macro that does this:
MACRO(alpha) expands to nothing
MACRO(X) expands to X m_##X (for all values of X except alpha)
My guess is that it is impossible. But then, in the Boost preprocessor
package, they achieve some things that I would also have thought
impossible.
This has to work in C, so I cannot use C++ templates.