alias of member from pointer to struct?

BCS ao at pathlink.com
Sat Apr 14 15:18:17 PDT 2007


Reply to Jarrett,

> If the static if is not at global scope, you can make a variable that
> points to the member:
> 
> const bool pick = false;
> 
> struct S
> {
> int i;
> int j;
> }
> void main()
> {
> S* s;
> static if(pick)
> int* var = &s.i;
> else
> int* var = &s.j;
> }


That's what I'm trying to avoid. :(




More information about the Digitalmars-d-learn mailing list