Please verify if my understanding about a pointer to member is correct. Here is an example class:
class T
{
public:
int *p;
int arr[10];
};
For "standard" pointers following opartions are common:
int a = 1;
int *p1 = &a;
int *p2 = p1 (other notation: int *p2 = &*p1);
//The pointer p2 points to the same memory location as p1.
The above operation for a pointer to member is impossible:
int T::*pM = &(*T::p); // error
A pointer to member contains an offset in the memory i.e. information how far away is placed particular member starting from the beggining of the class, so we don't know at this stage where a pointer inside the class points. Similary a pointer to member which is an array element is impossible because the address of the array element is unknown:
int T::*pM = &T::arr[5]; //error
But following operations are correct:
int* T::*pM = &T::p; //a pointer to a pointer
//the same operation for "standard" pointers:
int **p3 = &p2;
int (T::*pM)[10] = &T::arr; //a pointer to an array