当 min 被定义为宏时如何调用 std::min()?

2022-01-11 00:00:00 macros c++ stl

min 已经被定义为宏时,如何调用 std::min?

How do I call std::min when min has already been defined as a macro?

推荐答案

(std::min)(x,y)

min 周围的括号防止宏扩展.这适用于所有函数宏.

The parentheses around min prevent macro expansion. This works with all function macros.

相关文章