使用std:min(),std:max()
使用std:min(),std:max()注意事项。综合网上资料(见参考),有下面几种方法:
1.为了禁用Visual C++中的 min/max宏定义,可以在包含<windows.h>头文件之前加上:
#define NOMINMAX
2.NOMINMAX 加到 preprocessor difinitions 中。
参考:
1.windows使用介绍 http://support.microsoft.com/kb/143208
2.std:min(),std:max()介绍 http://blog.csdn.net/zicheng_lin/article/details/7173757
3.std:min(),std:max()与mfc冲突方法 http://www.4ucode.com/Study/Topic/1168766
4.std:min()介绍 http://huycwork.blog.163.com/blog/static/136751999201042022816960/
5.简单使用 http://blog.csdn.net/netrookie/article/details/5536014
6.vc支持std:min(),std:max()问题 http://blog.csdn.net/vipcowrie/article/details/1821107
本文介绍了如何在Visual C++中禁用可能导致与标准库函数std::min和std::max冲突的min/max宏定义。通过在包含<windows.h>前使用预处理器指令#define NOMINMAX或将NOMINMAX添加到预处理器定义中,可以避免此类命名冲突。
7355

被折叠的 条评论
为什么被折叠?



