I recently wanted to implement implicit sharing functions like Qt with its QSharedData and QSharedDataPointer , so I looked at their sources and instead of QSharedData found these three lines:
private:
However, I do not understand how operator= to break the reference count.
If I simply did not make it closed and left its implementation empty, would it serve the same purpose?
i.e. if I just wrote this:
public: QSharedData &operator=(const QSharedData & ) { return *this; }
source share