我可以逃避(抑制)C 预处理器宏扩展吗

Can I escape (suppress) C preprocessor macro expansion

我使用了以下代码:

auto t = numeric_limits<decltype(m)>::max() - 1;

后来,我需要#include <Windows.h>,其中有#define max(a, b)指令,所以我不能使用::max()方法。 有没有办法在不使用 #undef max 的情况下调用 ::max() 时抑制宏展开?

在编译器选项中或在包含 windows.h:

之前定义 NOMINMAX
#define NOMINMAX
#include <windows.h>