I want to make sure I understand this right.
I have an implicitly shared container, say a QHash. Object A creates it and passes it to object B by value.
A
{
}
A
{
QHash;
B.takeThis(QHash);
}
To copy to clipboard, switch view to plain text mode
So far, when reading from the QHash both A and B would read from the same memory block, right?
Now A modifies the QHash.
A
{
}
A
{
QHash;
B.takeThis(QHash);
QHash.addElement();
}
To copy to clipboard, switch view to plain text mode
Does the QHash get detached in this case? Or only when B modifies its own copy?
And if it does get detached, what happens when A modifies the QHash multiple times? Does it get detached every time?
Bookmarks