首页 > 解决方案 > Visual Studio 2019 中奇怪的宏扩展

问题描述

为什么代码末尾的调用扩展为hello, hello而不是hellohello?使用 Visual Studio 2019。

#define CONCAT2(a, b) a ##b

#define CONCAT_ALL_H3(n, ...) CONCAT##n(__VA_ARGS__)

CONCAT_ALL_H3(2, hello, hello)

演示

标签: c++visual-studiomacros

解决方案


推荐阅读