Why structs and classes instanciations are made differently ?

Andrea Fontana via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Mon Jul 24 08:37:51 PDT 2017


On Monday, 24 July 2017 at 15:21:54 UTC, Houdini wrote:
> Hello,
>
> I am a C++ coder, and I am learning D (just reading a book, for 
> now).
>
> D is very similar to C++ (and also grabs godd ideas from 
> Python), but I have a naive question : why does Walter Bright 
> chose to instanciate classes like in Java ? And why is it 
> different for structs ?

Maybe this will help you:
https://stackoverflow.com/questions/10965577/usage-preference-between-a-struct-and-a-class-in-d-language





More information about the Digitalmars-d-learn mailing list