[C++] std::numeric_limits::max() error: '(': illegal token on right side of '::'
来源:互联网 发布:阿里域名服务器地址 编辑:程序博客网 时间:2024/05/23 15:47
#include <limits>
x = std::numeric_limits<int>::max();
c:/.../x.cpp(192) : warning C4003: not enough actual parameters for macro 'max'
c:/.../x.cpp(192) : error C2589: '(' : illegal token on right side of '::'
c:/.../x.cpp(192) : error C2059: syntax error : '::'
错误原因:
包含的另一个头文件中包含了 max() 的宏定义。
解决方法:
添加代码:
#undef max
相关讨论:
- [C++] std::numeric_limits::max() error: '(': illegal token on right side of '::'
- Problem calling std::max: Illegal token on right side of ::
- std::numeric_limits::max()编译错误
- std::numeric_limits::max()编译错误
- std::numeric_limits::max() std::numeric_limits::min()编译错误
- std::numeric_limits::max() std::numeric_limits::min()编译错误
- std::numeric_limits::max() std::numeric_limits::min()编译错误
- PCL中std::numeric_limits::max()编译错误
- vs编译std::numeric_limits::max()编译错误
- std::numeric_limits<unsigned int>::max()编译错误
- -JSONValue failed. Error is: Illegal start of token []
- 'numeric_limits' is not a member of 'std'|
- 'numeric_limits' is not a member of 'std'
- Windows下编译std::numeric_limits::max() 和std::numeric_limits::min()出错
- error:structure required on left side of . or .*
- on std::numeric_limits<float>=1.192e-7
- sbjson解析json数据遇到JSONValue failed. Error is: Illegal start of token [Ô]解决办法
- erlang变量赋值出错exception error: no match of right hand side value
- assert使用
- 写Java Unit Test的几种模式
- 程序员是这么疯狂
- 面试点:关键字static(C语言面试题分析之三)
- android:解说Manifest里Activity属性
- [C++] std::numeric_limits::max() error: '(': illegal token on right side of '::'
- 设置UIViewController模态进入的动画
- windows7使用技巧
- 数据库备份和恢复(一)
- POJ2115 C Looooops 推广的欧几里得算法
- Lucene3 索引文件格式
- ListView分页显示数据
- 星座潜藏的恋爱实力
- 编译jrtplib第一个例子