Hazarding a guess, since you're using VC++ – put this before any #include
s:
#define NOMINMAX
windows.h
defines macros named min
and max
like so:
#define min(a,b) (((a) < (b)) ? (a) : (b))
#define max(a,b) (((a) > (b)) ? (a) : (b))
The Windows SDK has contained these macros since before C++ was standardized, but because they obviously play havoc with the C++ standard library, one can define the NOMINMAX
macro to prevent them from being defined.
As a rule, if you're using C++ (as opposed to C) and including windows.h
, always define NOMINMAX
first.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…