Suppose there is one object in my program, and several shared pointers for it. Will they count references to the object, if they are not created with assigning value to one another, but by constructing each independently from simple pointer.
Like, this:
MyObject *object = new MyObject;
QSharedPointer <MyObject> a, b, c, d;
a = QSharedPointer (object);
b = QSharedPointer (object);
c = QSharedPointer (object);
d = QSharedPointer (object);
MyObject *object = new MyObject;
QSharedPointer <MyObject> a, b, c, d;
a = QSharedPointer (object);
b = QSharedPointer (object);
c = QSharedPointer (object);
d = QSharedPointer (object);
To copy to clipboard, switch view to plain text mode
instead of this:
MyObject *object = new MyObject;
QSharedPointer <MyObject> a, b, c, d;
a = QSharedPointer (object);
b = a;
c = b;
d = c;
MyObject *object = new MyObject;
QSharedPointer <MyObject> a, b, c, d;
a = QSharedPointer (object);
b = a;
c = b;
d = c;
To copy to clipboard, switch view to plain text mode
Bookmarks