#define NOMINMAX using std::min/max

后端 未结 4 1058
春和景丽
春和景丽 2020-11-27 05:39

i recently added:

#define NOMINMAX
#include 
#include 

to my main.cpp in order to use

st         


        
4条回答
  •  孤独总比滥情好
    2020-11-27 06:30

    Define NOMINMAX via a compiler flag:

    > cl.exe -DNOMINMAX ...
    

    this will then be defined for all of the source files. I don't use the IDEs but this page provides guidance on navigating the IDE to set this: Using STL in Windows Program Can Cause Min/Max Conflicts :

    Simply define the NOMINMAX preprocessor symbol. This can be done in the Developer Studio project under Build, Settings, on the C/C++ tab, in the Preprocessor category. This will suppress the min and max definitions in Windef.h.

提交回复
热议问题