or也是隐式数据共享的

or也是隐式数据共享的

Behind the scenes, QString uses implicit sharing (copy-on-write) to reduce memory usage and to avoid the needless copying of data.
QVector也是隐式数据共享的;虽然文档没说但是看代码能知道

inline QVector(const QVector<T> &v) : d(v.d) { d->ref.ref(); if (!d->sharable) detach_helper(); }

05-15 16:46