I've look in the C++ standard and, when listing list of compound stuff, it does not mention anything like "pointer to data member of an instantiated class". So the question is:
struct test{
int a;
double d;
.....
//more complicated stuff here to make it a NON-pod structure)
....
};
test t;
double * pd;
void main(){
pd = &(t.d); // IS THIS PERMITTED?
// then use pd as a normal pointer to double
}
I really don't see why it shouldn't be permitted after all each object has a defined location and each member as a defined location so the address of the data is well defined.
But with C++ things are almost never what seem logical or intuitive.
So can some of the knowledgeable person here tell me if it is ok, and if so direct me to some part of the C++ standard that say so (maybe ISO 5.2.5 actually means it is ok, but I am not sure) ?
In the stunning case it would not be permitted, would it be permitted if the struct was a plain vanilla POD structure (if not, I'll be totally astonished)