structs vs classes
Simen kjaeraas
simen.kjaras at gmail.com
Sat Jan 29 06:33:55 PST 2011
Jim <bitcirkel at yahoo.com> wrote:
> I'm only discussing the heap/stack difference.
In D you are allowed to safely put your structs on the heap, and
unsafely put your classes on the stack. What more do you want?
Also, a D struct is POD. It has no vtable, it does not support
subtyping except via alias this, and it is simply a different
beast from classes. This is a good thing, as you often want such
a light-weight abstraction. How would you suppose we retain this
if we were to abolish this dichotomy?
--
Simen
More information about the Digitalmars-d
mailing list