I have defined a few outputmacros, where I want to check some parameters at compiletime.
To make a simple example, I would have a function with one paramater, which i want to be “valueA” or “valueB”.
outputmacro: ^foo(^arg1)
now I want to prevent myself, that if I just make a typo, i have the risk of not recognizing it and having my program not working. This would maybe a mistake, which is hard to find.
To prevent this I want to do a check at compiletime.
For simple cases I could think of writing wrapper functions, which would be in the case above:
outputmacro: ^fooValueA()
^foo(valueA)
outputmacro: ^fooValueB()
^foo(valueB)
outputmacro: ^foo(^arg1)
This way is not that elegant and gets hard if you have more possibilites and a function which takes more arguments, because than you would have to write a lot of wrappers.
Can you think of another way to do it?