Do we really need const?

Nathan Reed nathaniel.reed at gmail.com
Tue Sep 18 18:17:12 PDT 2007


Bruce Adams wrote:
> That's one thing I've heard bandied around here, that structs are passed by value and classes by reference. It seems too peculiar to be true. 

It's true.  Why do you find this peculiar?  Structs are aggregate data 
structures with value semantics, and classes are aggregate data 
structures with reference semantics.  For some problems you want one, 
and for some you want the other.

Thanks,
Nathan Reed



More information about the Digitalmars-d mailing list