Problem calling std::max Problem calling std::max windows windows

Problem calling std::max


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