今天看到qstring.h文件中的QString 的拷贝构造函数是这样写的
inline QString::QString(const QString &other) : d(other.d)
{ Q_ASSERT(&other != this); d->ref.ref(); }
不太明白 Q_ASSERT(&other != this)
这一句,othrer!=this????这个异常再怎样的情况下会触发?能否举个例子
今天看到qstring.h文件中的QString 的拷贝构造函数是这样写的
inline QString::QString(const QString &other) : d(other.d)
{ Q_ASSERT(&other != this); d->ref.ref(); }
不太明白 Q_ASSERT(&other != this)
这一句,othrer!=this????这个异常再怎样的情况下会触发?能否举个例子