【发布时间】:2016-04-26 13:39:21
【问题描述】:
'因为每当我尝试这些行之一时:
#define and &&
#define or ||
#define not !
我得到错误:
1:9: error: "not"/"and"/"or" cannot be used as a macro name as it is an operator in C++
【问题讨论】:
-
为什么...你会想要定义这些吗?为什么让你的代码不可读?
-
不可读?来吧。
-
Unexpected 是不可读的。我打赌接下来你会做
#define loop for -
不。
#define for for(对我来说已经足够了
标签: c++ operator-overloading operators user-defined