On 1/4/2012 3:21 PM, bearophile wrote:
The only reason to use classes in D is for polymorphic behavior - and that
means virtual functions.

I don't agree, in some cases I use final class instances instead of
heap-allocated structs even when I don't need polymorphic behaviour just to
avoid pointer syntax (there is also a bit higher probability of destructors
being called, compared to heap-allocated structs). In some cases I've used a
final class just to be able to use a this() with no arguments :-)


There's no reason to avoid pointer syntax, because D has:

1. ref types

2. automatic dereferencing of pointers

Reply via email to