banging my head on the c++, again
Sep. 2nd, 2008 08:02 pmIs it possible in C++ to declare and initialize a pointer-to-member that points to a data member of a data member? Concretely, given
struct A { int x; int y; };
struct B { A i; A ii; A iii; A iv; };
I would like to be able to do something like this:
TYPE piix = INITIALIZER<B, ii, x>; ... B b; int x_within_ii = b.*piix;
Is this possible? If so, exactly how do you write TYPE and INITIALIZER? If not, why the hell not?