Is this a bug?

Andrey via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Mon Apr 28 04:31:00 PDT 2014


bearophile, John, probably, my example was not clear...

The code below works.

alias short Type1;
alias Type1[100]* Type2; // if I take out '*' I will have to type 
it everywhere, because arrays in D2 always 'by value'

struct Type3
{
	Type1 key;
	int  flags;
         int  arrLen;
	Type2 f; // this struct can be *optionally* extended by the array
}

void foo(Type3* b)
{
    Type1  d;
    d = (*(*b).f)[10];
}

Thank you, I appreciate your help!!


More information about the Digitalmars-d-learn mailing list