In a recent update to your main.cpp file, you introduced the following preprocessor directive:
#define NOMINMAX #include#include
This action allows you to utilize the std::max and std::min functions within your code. However, subsequent attempts to employ these functions within other files yield errors such as:
error C2589: '(' : illegal token on right side of '::' error C2059: syntax error : '::'
Despite attempts to define NOMINMAX in these additional files, the issue persists.
The issue lies in the fact that NOMINMAX defines aliases for the Windows min and max macros, overwriting the standard C versions provided by
(std::min)(x, y);
This approach avoids invoking the function-like macros, allowing the standard C versions to be applied.
Disclaimer: All resources provided are partly from the Internet. If there is any infringement of your copyright or other rights and interests, please explain the detailed reasons and provide proof of copyright or rights and interests and then send it to the email: [email protected] We will handle it for you as soon as possible.
Copyright© 2022 湘ICP备2022001581号-3