[question] Access from UDA constructor to parent symbol

Adam D. Ruppe via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Mon Dec 26 13:15:03 PST 2016


On Monday, 26 December 2016 at 20:07:56 UTC, crimaniak wrote:
>          // I want to see Foo here and use it's reflection to 
> iterate fields and methods.

then pass foo to it....

What do you mean parent symbol? I assumed you mean subclass but 
your example shows one class and one struct. So is it the 
structure containing the class? Or what?


But, the answer of just passing the argument is probably the best 
one anyway. You can use a factory function, or pass the type from 
a constructor to a super method, or something like that.


More information about the Digitalmars-d-learn mailing list