__typeof(self) is good for portability, since it is not tied to a particular class, however, the &* trick seems clearly redundant. As far as I know, in C and therefore Objective-C , &*ptr completely equivalent to ptr .
However, this may not be valid in other C-like languages, such as C++ , because statements can be overloaded and semantics may not be as simple as they seem. In fact, I saw that &* already in C++ applications, especially when working with iterators. I assume that the author has a C++ background and why he inserted this redundant construct.
In any case, I could be wrong, and I would like to hear a more sophisticated explanation, it is.
Gabriele petronella
source share