Classes or stucts :: Newbie

spir denis.spir at gmail.com
Mon Dec 20 01:19:31 PST 2010


On Sun, 19 Dec 2010 21:33:56 -0500
bearophile <bearophileHUGS at lycos.com> wrote:

> >So, putting classes on the stack kind of negates the whole point of having both structs and classes in the first place.<  
> 
> This is false, the definition of D class instance doesn't specify where the instance memory is allocated.

For me, the important difference is that classes are referenced, while structs are plain values. This is a semantic distinction of highest importance. I would like structs to be subtype-able and to implement (runtime-type-based) polymorphism.

Denis
-- -- -- -- -- -- --
vit esse estrany ☣

spir.wikidot.com



More information about the Digitalmars-d-learn mailing list