You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Needs a check that will find std::min and std::max invocations without surrounding parentheses over the name. The check will suggest to insert parentheses around the name.
BEFORE:
int result = std::min(a, b);
AFTER:
int result = (std::min)(a, b);
Without parentheses the code that uses std::min and std::max might lead to compilation error in MSVC:
#include <algorithm> // std::min
#include <windows.h> // min macro
int main() {
int a = 5, b = 10;
// Compilation error in MSVC:
// "error C2589: '(': illegal token on right side of '::'"
int result = std::min(a, b);
return 0;
}