Question about auto ref

Jonathan M Davis jmdavisProg at gmx.com
Tue Mar 26 09:56:20 PDT 2013


On Tuesday, March 26, 2013 17:22:29 Namespace wrote:
> On Tuesday, 26 March 2013 at 11:41:13 UTC, Namespace wrote:
> > I wonder, if someone has already thought about "immutable ref".
> > I can not imagine that many use it, so it wouldn't break (much)
> > code.
> 
> immutable ref works (for me) very well. Are there any pitfalls
> that I can not see?

That there's no immutability involved? That would be an incredibly misleading 
choice. Not to mention, you can probably have a perfectly valid immutable ref 
right now if you want to pass a an immutable variable by ref, and using 
immutable ref for this would change its semantics. We probably just need an 
@something attribute with a good name.

- Jonathan M Davis


More information about the Digitalmars-d-learn mailing list