mutable reference to const object

Jonathan M Davis jmdavisProg at gmx.com
Tue Oct 12 15:54:49 PDT 2010


On Tuesday, October 12, 2010 15:27:41 Jesse Phillips wrote:
> Jonathan M Davis Wrote:
> > Unfortunately, at this point, tail const has pretty much been decided to
> > be too difficult implement and/or too difficult to do cleanly, so it's
> > not in D and likely never will be. If it's mentioned in the online docs,
> > the docs need to be updated. It's been a long time since there was any
> > kind of tail const in D.
> > 
> > - Jonathan M Davis
> 
> What I have heard is that it can't be done syntactically for references. As
> Denis shows you can do it with points (and arrays) but not object
> references.
> 
> There are many syntax suggestion threads so I suggest search for them
> before bring it up again.

Yes, you can do it with pointers, but not with references, and it causes 
problems for stuff like ranges. There have been several discussions on it over 
time, and Walter has pretty much said that it's not a feature that's going to 
happen. He spent too much time on it before without success to want to try at it 
again.

- Jonathan M Davis


More information about the Digitalmars-d-learn mailing list