この行は小さなテストプログラムでは正しく機能しますが、必要なプログラムでは、次のコンパイラの苦情があります。
#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 : '::'
同じ結果が得られます:
#include <limits>
using namespace std;
x = numeric_limits<int>::max();
maxをマクロmax(a、b)と見なすのはなぜですか。?