Getting too many arguments provided to function-like macro invocation compile error while defining lambda inside assert (assert.h) in Xcode [c++]

后端 未结 2 816
醉话见心
醉话见心 2020-12-20 18:29

I am using assertion macro from assert.h I have defined lambda to perform assertion checking.

int val1 = 0;
int val2 = 1;

const auto check = [val1,val2]()-&         


        
2条回答
  •  抹茶落季
    2020-12-20 19:00

    The preprocessor is very simple, it sees all commas as argument separators.

    So you can't use a macro if you pass in anything with a comma as argument to the macro.

提交回复
热议问题