const by default.

Walter Bright newshound at digitalmars.com
Fri Jul 7 12:56:44 PDT 2006


kris wrote:
> Er, that's great, but does it provide for const return-values?

No, it does not.

> You see, 
> the above can be handled adequately via either struct or class /right 
> now/ ~ but their immutablity can quickly unravel when, for example, 
> exposing content via toString() or whatever. And please don't suggest 
> returning a .dup of the content instead.

I've argued against the .dup method many times <g>.



More information about the Digitalmars-d mailing list