Re: Method definition

2021-07-21 Thread Tim Gunesh via Digitalmars-d-learn
On Wednesday, 21 July 2021 at 14:02:42 UTC, Adam D Ruppe wrote: On Wednesday, 21 July 2021 at 13:56:11 UTC, Tim Gunesh wrote: This allows you to quickly understand the content of the class, especially in large undocumented projects. The D compiler can auto-generate listings like that. dmd -H

Re: Method definition

2021-07-21 Thread Adam D Ruppe via Digitalmars-d-learn
On Wednesday, 21 July 2021 at 13:56:11 UTC, Tim Gunesh wrote: This allows you to quickly understand the content of the class, especially in large undocumented projects. The D compiler can auto-generate listings like that. dmd -H makes a .di file with the bodies stripped out you can pursue, or

Re: Method definition

2021-07-21 Thread Tim Gunesh via Digitalmars-d-learn
On Wednesday, 21 July 2021 at 12:08:21 UTC, Tim Gunesh wrote: Is it possible to define methods outside the class in C ++ style? Something like this: ```d class Parent{ void Print(); } void Parent.Print(){ writeln("Hello, D!"); } ``` I was afraid that this is not possible. I'm partly us

Re: Method definition

2021-07-21 Thread bauss via Digitalmars-d-learn
On Wednesday, 21 July 2021 at 12:08:21 UTC, Tim Gunesh wrote: Is it possible to define methods outside the class in C ++ style? Something like this: ```d class Parent{ void Print(); } void Parent.Print(){ writeln("Hello, D!"); } ``` No and it doesn't make much sense to do so. The reas

Re: Method definition

2021-07-21 Thread Paul Backus via Digitalmars-d-learn
On Wednesday, 21 July 2021 at 12:08:21 UTC, Tim Gunesh wrote: Is it possible to define methods outside the class in C ++ style? Something like this: ```d class Parent{ void Print(); } void Parent.Print(){ writeln("Hello, D!"); } ``` No, it's not possible. However, [uniform function ca

Method definition

2021-07-21 Thread Tim Gunesh via Digitalmars-d-learn
Is it possible to define methods outside the class in C ++ style? Something like this: ```d class Parent{ void Print(); } void Parent.Print(){ writeln("Hello, D!"); } ```