Problem calling std::max

十年热恋 提交于 2019-11-28 16:57:33

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);

Define the NOMINMAX symbol at the top of your source, before you include any headers. Visual C++ defines min and max as macros somewhere in windows.h, and they interfere with your use of the corresponding standard functions.

#define NOMINMAX
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!