I have 207 real examples of operator &() : Code Search 1 , Code Search 2 .
Including SafeInt<> (to get the base integer), boost :: gil (apparently also for getting raw data), Mozilla (say, "it's risky to define the & operator, but hey, we know what we're doing." ), wxWidgets, Armagetron, and more.
It seems that the idiom &*it iterator is used to get the source link or pointer back, and write *&it to get the source link and &it to get the raw pointer.
Please note: if your type overloads operator& and returns something other than the built-in operator, your type will no longer be copied (in C ++ 03 - C ++ 0x seems to have removed it), and therefore cannot be used anymore as an elemental type in a standard container.
source share