, .
, , static const array-of-pointer-to-member. operator[] , -, this .
This works because pointers to elements are not ordinary pointers; they are a little more magical than that. (This allows you to create non-bound pointers to member functions and why they cannot be used where simple function pointers are expected).
It also means that you donβt need to use any casting tricks, rely on any kind of alignment, intolerable behavior of anonymous merging or guarantees of the layout of the memory, and you can still refer to the structure components as named fields and not through access functions.
source
share