const debacle

Steven Schveighoffer schveiguy at yahoo.com
Wed Mar 26 09:04:28 PDT 2008


"Janice Caron" wrote
>I think I've got it.
> ...

Janice, if you look closely, this follows EXACTLY my proposition in 
"Proposal for scoped const contracts", just substitute foo for inout :)  But 
I'm glad we came to the same conclusion...

BTW, I think I like 'inout' better than 'in' and 'out' separately, and inout 
is DEFINITELY fair game as ref has completely superceded it :)

Your way of explaining how the resolution of inout works as 3 separate 
function bindings is good for understanding purposes.  I'd amend my rules to 
be similar:

1) if all inouts are all homogeneous (i.e. all are mutable, all are const, 
or all are invariant), then the version of the function with that same 
constancy is called.
2) otherwise, the const version is called.

Other than that, this is exactly what I proposed and what I think should be 
implemented.

-Steve 





More information about the Digitalmars-d mailing list