Is it possible to write some class members in another module ?

welkam wwwelkam at gmail.com
Wed May 20 15:01:36 UTC 2020


On Wednesday, 20 May 2020 at 09:45:48 UTC, Vinod K Chandran wrote:
> // Now, we need to use like this
> auto form= new Window();
> form.event.click = bla_bla;
>
> // I really want to use like this
> auto form= new Window();
> form.click = bla_bla;
> ```

Then you want alias this.

class Window : Control{
    Events event;
    alias event this
    .....
}

and now when you write
form.click = bla_bla;
Compiler first checks if form.click compiles and if it doesnt it 
then it tries form.event.click


More information about the Digitalmars-d-learn mailing list