Const Ideas (and reference types)

Craig Black cblack at ara.com
Fri Nov 30 13:27:20 PST 2007


> So if you're going peel off the hidden ref, I think you might should make 
> it:
>
>     ref X x --> const ref(T) x;
> or          --> const (T)ref x;
> or          --> ref const(T) x;
>
> #3 seems pretty good to me.  But anyway no one knows what Walter will 
> decide to do.

Good point here.

Here's another idea.  If we reverse the meaning of const(X) then we could do 
this:

const X x;  // all const
const(X) x; // data const, ref mutable
X const x; // data mutable, ref const 





More information about the Digitalmars-d mailing list