我的意思是,我们都知道有否定逻辑运算符 !
,它可以这样使用:
class Foo
{
public:
bool operator!() { /* implementation */ }
};
int main()
{
Foo f;
if (!f)
// Do Something
}
是否有任何运营商允许这样做:
if (f)
// Do Something
我知道这可能不重要,但只是想知道!
最佳答案
关于c++ - C++中是否有 "normal"一元逻辑运算符,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8955206/