[ADT] Generalize pointee_iterator to smart pointers by using decltype.
Based on review feedback from Dave on the original patch.