iterators again

David B. Held dheld at codelogicconsulting.com
Sun May 27 19:37:17 PDT 2007


Bill Baxter wrote:
> [...]
> And classes don't have fully useful copy c'tors either, so you can't 
> really hold that against structs.

Classes have reference semantics, so you need to implement a clone() 
method if you want deep copies.  Value types need to support 
copy/assign/swap as first-class operations.

> [...]
> The only think I've thought of (and this is probably Tango's main 
> justification for classes) is that structs can't inherit.

There is some talk about allowing structs to implement interfaces, but 
that is a technically non-trivial change.

Dave



More information about the Digitalmars-d mailing list