class initialization

thedeemon dlang at thedeemon.com
Tue Jan 16 11:08:56 UTC 2018


On Tuesday, 16 January 2018 at 03:23:20 UTC, Marc wrote:

> But can't figure out if D does have that for classes.

I believe there's no such thing for classes, you're supposed to 
use constructors. Class objects are in many aspects more abstract 
things than POD structs: instead of accessing their data directly 
there are constructors, virtual (by default) methods, and there 
is inheritance and interfaces which require the accesses to be 
rather abstract and indirect to work well.


More information about the Digitalmars-d-learn mailing list