鍘熷洜錛?/strong>鐢變簬澶存枃浠禬indows.h涓殑瀹氫箟浜嗗畯max鍜宮in閫犳垚鐨勩傚湪Windows.h澶存枃浠朵腑瀹氫箟浜嗗畯max鍜宮in錛孭reprocessor灝辮涓烘垜浠嬌鐢ㄧ殑鏄畯max鎴杕in錛岃屽啀璋冪敤鏃惰皟鐢ㄦ柟娉曞拰鍙傛暟涓庡畾涔夌殑瀹忎笉涓鑷達紝鎵浠ユ姤閿欍?/p>
瑙e喅鏂規(guī)錛?/strong>鐢ㄦ嫭鍙鋒潵鏀瑰彉Preprocessor瀵規(guī)柟娉曞悕鐨勭悊瑙c?/p>
渚嬶細 鍙傝錛?/strong>http://www.jeffhung.net/blog/articles/jeffhung/626/
(std::numeric_limits<Byte>::max)()
// 浣跨敤stl涓殑max鏂規(guī)硶
(std::max)( 1, 2 );
// 鑷畾涔夊悕涓簃ax鐨勬柟娉?/span>
struct Number
{
int (max)();
};
]]>