Variadic recursive preprocessor macros - is it possible?

前端 未结 6 874
一生所求
一生所求 2020-11-28 07:11

I\'ve run into a little theoretical problem. In a piece of code I\'m maintaining there\'s a set of macros like

#define MAX_OF_2(a, b)       (a) > (b) ? (a         


        
6条回答
  •  清酒与你
    2020-11-28 07:52

    If you're going down this road in C++, take a look at template metaprogramming. It's not pretty, and it may not solve your exact problem, but it will handle recursion.

提交回复
热议问题