Stepping back and looking at constness from another angle.

Lionello Lunesu lio at lunesu.remove.com
Fri Jun 8 04:00:48 PDT 2007


Regan Heath wrote:
> Denton Cockburn Wrote:
>> Again, I'm also trying to understand this, knowing that things change a 
>> lot over the course of the discussion. That being said, I thought the 
>> current position is that by adding any other qualifier, such as ref, 
>> const/scope/final is no longer automatically applied.
> 
> I thought so too.  As Don says; 'ref' is an alias of 'inout'.  It's ver
> y purpose is to indicate a variable which is going to be modified.  Therefore it stands to reason that function parameters passed as 'ref' will be mutable by default. :)

Actually, it might be a nice distinction to keep both 'inout' and 'ref', 
where 'inout' would be mutable, but 'ref' not? 'ref' would then be an 
optimized version of 'in'.

Or will 'inout' disappear completely?

L.



More information about the Digitalmars-d mailing list