www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.learn - Structs, Classes, Templates

reply alex <ask nospam.com> writes:
I think I understand the concept of a template, the declaration of a 
class that you never actually have to create, right?

But I am hazy on the difference between sructs and classes, and can't 
seem to get a clear understanding from the website.
-- 
Alex Herrmann
PC load letter
Sep 24 2011
parent Jacob Carlborg <doob me.com> writes:
On 2011-09-24 20:59, alex wrote:
 I think I understand the concept of a template, the declaration of a
 class that you never actually have to create, right?

 But I am hazy on the difference between sructs and classes, and can't
 seem to get a clear understanding from the website.
Classes are always reference types allocated on the heap, used for polymorphic types. Supports inheritance. Structs are, by default, value types and does not support inheritance. -- /Jacob Carlborg
Sep 24 2011