I've been reading about smart pointer comparison operators.
http://www.open-std.org/jtc1/sc22/wg...004/n1590.html
Namely, I was interested in understanding why the == operator is not defined for weak pointers. The link above taught me that not even for shared pointers is the == operator safe.
A few doubts arised reading the above article. I would need your help understanding them:
. What is meant by two shared pointers sharing ownership but pointing to different subobjects? How can this be?
. what is meant by two shared pointers that have a custom deleter that doesn't delete? Is this a reference to bad code?
. What is the address of weak pointers control block?
Finally, not so related, I still have a little trouble understanding the advantage of weak pointers. I understand they don't increment the use count of the shared pointer they point to, however this comes at the expense of ending to manually manage my weak pointers when the shared pointer is deleted. Also, since they don't implement the == operator, i'm left with few choices at to the type of container I can use them in; sets and maps.