Stepping back and looking at constness from another angle.

Deewiant deewiant.doesnotlike.spam at gmail.com
Fri Jun 8 07:40:00 PDT 2007


Lionello Lunesu wrote:
> Regan Heath wrote:
>> 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?
> 

'ref' meaning what C++'s 'const foo&' is how I originally understood it, but
from all the discussion I've gathered that 'inout' will be deprecated and then
phased out after all. So 'ref' will be only the new name for 'inout'.

I hope I'm wrong, I think 'inout' is more self-documenting than 'ref'.

-- 
Remove ".doesnotlike.spam" from the mail address.



More information about the Digitalmars-d mailing list