将是辅助运算符(=)返回左(或右部分)的值吗?
QVector<function>::Iterator it;
binOp *bpl = nullptr;
bool b1 = (bpl = dynamic_cast<binOp *>(&*(it-2))) != nullptr;因此,我有自己的类(binOp : function),我尝试在表达式中使用dynamic_cast。如果我将赋值给bpl,它是否等于bpl,并且是这样的?:
bpl = dynamic_cast<binOp *>(&*(it-2)));
bool b2 = bpl != nullptr;那么b1是否等于b2?
发布于 2021-02-17 21:03:51
= assignment operator返回对左操作数的引用.所以,你的第一个例子会工作得很好,结果将相当于你的第二个例子。
https://stackoverflow.com/questions/66249907
复制相似问题