question about multiple alias this

steven kladitis via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Thu Sep 24 06:04:20 PDT 2015


class A{
   int i;
   bool b;
   alias i this;
   alias b this;
}

void main()
{
   auto a = new A;
   int i = a;
   bool b = a;
}

--- this will not compile in dmd 2068.1.
--- ok, but what technique do you use to emulate this type of 
behavior??
--- would interfaces be the answer, if so could I see an example. 
and would you use the
--- same for structs ??????
--- thanks, Steven


More information about the Digitalmars-d-learn mailing list