Logical const

Jonathan M Davis jmdavisProg at gmx.com
Thu Dec 2 10:23:54 PST 2010


On Thursday, December 02, 2010 01:18:31 Don wrote:
> Walter Bright wrote:
> > spir wrote:
> >> What would be the consequences if D had no const, only immutable
> >> (that, IIUC, removes the latter non-guarantee)?
> > 
> > You'd have to write most every function twice, once to take immutable
> > args and again for mutable ones.
> 
> Doesn't 'inout' do almost the same thing?
> The only difference I can see between const and inout, is that inout
> tells which parameters could be aliased with the return value.

Except that doesn't inout actually produce multiple versions of the function, 
whereas with const, you only get the one?

- Jonathan M Davis


More information about the Digitalmars-d mailing list