标准库std::min/std::max与min/max宏冲突
2017-12-14 12:04
1091 查看
如题,因为
工程中如果包含了
解决的办法就是定义
windef.h中定义了
max和
min宏:
#ifndef NOMINMAX #ifndef max #define max(a,b) (((a) > (b)) ? (a) : (b)) #endif #ifndef min #define min(a,b) (((a) < (b)) ? (a) : (b)) #endif #endif /* NOMINMAX */
工程中如果包含了
windows.h或
windef.h头文件,再使用c++标准库
std::min或
std::max,就会发生编译错误。
解决的办法就是定义
NOMINMAX宏,一般是在工程配置中定义。
相关文章推荐
- vc中对标准库std::min,max,swap的支持问题
- std::min,std::max 与 MFC冲突的解决
- std::min and std::max
- std::min and std::max 出错解决方案
- std::min&std::max与mfc冲突问题
- std::min&std::max与mfc冲突问题
- std::numeric_limits::max() std::numeric_limits::min()编译错误
- std::min 与std::max 的 Compiler Error C2780
- std::min and std::max
- cocos2d-x :Build errors “min/max is not a member of std”
- std::min and std::max
- C++笔记——std::min_element和std::max_element
- std::min and std::max与windows.h定义的min和max宏相冲突.
- std::min and std::max
- 使用std:min(),std:max()
- std::min, std::max, std::swap, std::rel_ops的简单使用
- std::max, std::min错误
- std::min std::max
- 【SPL标准库专题(7)】 Datastructures:SplHeap & SplMaxHeap & SplMinHeap
- VS2015--win32工程配置的一些想法之算法min/max与windows中的 min/max宏冲突