Re: Accessing outer class attribute from inner struct

2017-08-29 Thread Andre Pany via Digitalmars-d-learn
On Tuesday, 29 August 2017 at 08:30:24 UTC, Moritz Maxeiner wrote: On Tuesday, 29 August 2017 at 07:59:40 UTC, Andre Pany wrote: On Monday, 28 August 2017 at 23:12:40 UTC, Moritz Maxeiner wrote: In both cases S doesn't inherently how about C, which means a solution using default

Re: Accessing outer class attribute from inner struct

2017-08-29 Thread Moritz Maxeiner via Digitalmars-d-learn
On Tuesday, 29 August 2017 at 07:59:40 UTC, Andre Pany wrote: On Monday, 28 August 2017 at 23:12:40 UTC, Moritz Maxeiner wrote: In both cases S doesn't inherently how about C, which means a solution using default initialization is not feasible, as S.init can't know about any particular

Re: Accessing outer class attribute from inner struct

2017-08-29 Thread Andre Pany via Digitalmars-d-learn
On Monday, 28 August 2017 at 23:12:40 UTC, Moritz Maxeiner wrote: In both cases S doesn't inherently how about C, which means a solution using default initialization is not feasible, as S.init can't know about any particular instance of C. I don't think there's any way for you to avoid using

Re: Accessing outer class attribute from inner struct

2017-08-28 Thread Moritz Maxeiner via Digitalmars-d-learn
On Monday, 28 August 2017 at 22:47:12 UTC, Andre Pany wrote: On Monday, 28 August 2017 at 22:28:18 UTC, Moritz Maxeiner wrote: On Monday, 28 August 2017 at 21:52:58 UTC, Andre Pany wrote: [...] To make my question short:) If ColumnsArray is a class I can access the attribute "reference" but

Re: Accessing outer class attribute from inner struct

2017-08-28 Thread Andre Pany via Digitalmars-d-learn
On Monday, 28 August 2017 at 22:28:18 UTC, Moritz Maxeiner wrote: On Monday, 28 August 2017 at 21:52:58 UTC, Andre Pany wrote: [...] To make my question short:) If ColumnsArray is a class I can access the attribute "reference" but not if it is a struct. I would rather prefer a struct, but

Re: Accessing outer class attribute from inner struct

2017-08-28 Thread Moritz Maxeiner via Digitalmars-d-learn
On Monday, 28 August 2017 at 21:52:58 UTC, Andre Pany wrote: [...] To make my question short:) If ColumnsArray is a class I can access the attribute "reference" but not if it is a struct. I would rather prefer a struct, but with a struct it seems I cannot access "reference". How can I

Accessing outer class attribute from inner struct

2017-08-28 Thread Andre Pany via Digitalmars-d-learn
Hi, I build some framework to access Delphi components from D. Delphi supports property array access "StringGrid1.Columns[2]" which is translated in Delphi to a private method call "GetColumn(2)". I need to imitate this behavior in my D code. Therefore my TCustomGrid class has a inner struct