Const ref and rvalues again...

martin kinke at libero.it
Thu Nov 8 16:11:05 PST 2012


On Thursday, 8 November 2012 at 22:44:26 UTC, Jonathan M Davis 
wrote:
> I honestly wish that in didn't exist in the language. The fact 
> that it it's an alias two different attributes is confusing, and
> people keep using it without realizing what they're getting 
> into.
> If scope worked correctly, you'd only want it in specific
> circumstances, not in general. And since it doesn't work 
> correctly
> aside from delegates, once it _does_ work correctly, it'll break
> code all over the place, because people keep using in, because 
> they like how it corresponds with out or whatever.

I agree that it may likely be a cause for future issues. I 
wouldn't remove it though, rather relax it to an alias for const 
only (yes, because I like how it corresponds with out (input only 
vs. output only) and especially because it is very short - this 
diff of 3 characters really make a difference in function 
signatures :D). That'd fortunately still be possible without 
breaking existing code.

So please generalize my countless mentionings of 'in ref' to 
'const ref'. ;)


More information about the Digitalmars-d mailing list