The workaround is to use the parenthesis: int max = (std::numeric_limits<int>::max)();
It allows you to include the windef.h
, doesn't require you to #undef max
(which may have adverse side effects) and there is no need to #define NOMINMAX
. Works like a charm!
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…