[question] Access from UDA constructor to parent symbol

2016-12-26 Thread crimaniak via Digitalmars-d-learn
``` class uda { this() { // I want to see Foo here and use it's reflection to iterate fields and methods. } } @uda struct Foo { } ``` Is there a way to do it?

Re: [question] Access from UDA constructor to parent symbol

2016-12-26 Thread Adam D. Ruppe via Digitalmars-d-learn
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

Re: [question] Access from UDA constructor to parent symbol

2016-12-26 Thread crimaniak via Digitalmars-d-learn
On Monday, 26 December 2016 at 21:15:03 UTC, Adam D. Ruppe wrote: 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

Re: [question] Access from UDA constructor to parent symbol

2016-12-26 Thread Ali Çehreli via Digitalmars-d-learn
On 12/26/2016 02:04 PM, crimaniak wrote: So my main question: how it is possible to do such thing? Just to make sure we're on the same page: :) * There is 'interface' in addition to 'class' * If all you want is to check, then you can write template constraints by following the example of st

Re: [question] Access from UDA constructor to parent symbol

2016-12-27 Thread crimaniak via Digitalmars-d-learn
On Tuesday, 27 December 2016 at 02:05:27 UTC, Ali Çehreli wrote: On 12/26/2016 02:04 PM, crimaniak wrote: So my main question: how it is possible to do such thing? Just to make sure we're on the same page: :) * There is 'interface' in addition to 'class' Yes. I want it for structs exactly.

Re: [question] Access from UDA constructor to parent symbol

2016-12-27 Thread Jerry via Digitalmars-d-learn
On Monday, 26 December 2016 at 21:15:03 UTC, Adam D. Ruppe wrote: 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