As the question stands, I doubt meta programming is the answer. In particular, I don’t see the value of the macro over a function.
Maybe you could explain what the end goal is and why you believe meta programming is the correct way to get there. I’m saying this, because more often than not, it isn’t.