I am a biginer to Qt and referring to some tutorials on implicit ans explicit sharing and I came across following article.
http://cdumez.blogspot.com/2011/03/implicit-explicit-data-sharing-with-qt.html
in the code section I was not able to understand the functionality of the following operator
Contact& Contact::operator=(const Contact& other) {
d = other.d;
return *this;
}
If some one could explain this what exactly this does and why it is there for in code it would be a great help.
Thanks guys.
~Tharanga
He is overloading the assignment operator. That way, when he says
c2.dwill be the same asc1.d.It is not
Qtspecific. Also see this long explanation.