This line works correctly in a small test program, but in the program for which I want it, I get the following compiler complaints:
#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 : '::'
I get the same results with:
#include <limits>
using namespace std;
x = numeric_limits<int>::max();
Why is it seeing max as the macro max(a,b); ?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…