【发布时间】:2016-03-01 03:10:34
【问题描述】:
怎么了?我希望 xconcat 线工作。
#define concat(a,b) a ## b
#define xconcat(a,b) concat(a,b)
int main() {
xconcat(xconcat(boost::variant<,int), >) y;
boost::variant<int> x;
return 0;
}
g++ -E x.cpp
# 1 "x.cpp"
# 1 "<built-in>"
# 1 "<command-line>"
# 1 "x.cpp"
int main() {
x.cpp:5:1: error: pasting "<" and "int" does not give a valid preprocessing token
x.cpp:5:1: error: pasting "int" and ">" does not give a valid preprocessing token
boost::variant<int > y;
boost::variant<int> x;
return 0;
}
【问题讨论】:
-
注意:取消标签编辑(删除了 1 个正确的标签,添加了 3 个不正确的标签)
标签: c boost c-preprocessor