Problem calling std::max

后端 未结 2 1047
[愿得一人]
[愿得一人] 2020-12-12 22:21

I compiled my bison-generated files in Visual Studio and got these errors:

...\\position.hh(83): error C2589: \'(\' : illegal token on right side of \

2条回答
  •  感动是毒
    2020-12-12 23:09

    You are probably including windows.h somewhere, which defines macros named max and min.

    You can #define NOMINMAX before including windows.h to prevent it from defining those macros, or you can prevent macro invocation by using an extra set of parentheses:

    column = (std::max)(1u, column + count);
    

提交回复
热议问题