My thoughts & tries with rvalue references

Namespace rswhite4 at googlemail.com
Fri Apr 5 02:08:42 PDT 2013


> I am surprised to hear that redundant storage classes are 
> considered an error by dmd :) Makes no sense for me, typical 
> "generic code gen" use case story.
http://dpaste.1azy.net/3ef7a084

> Sorry then, I have misunderstood you then. I do want both 
> "scope ref" and "const scope ref" too, but I was thinking that 
> simple easy-to-use shortcut (in) should match most idiomatic 
> and safe use case, and that should be "scope const ref". With 
> an additional benefit of being able to replace values with refs 
> transparently due to storage class/qualifier restrictions.
>
> I don't have strong opinion here, it is just an idea that came 
> to my mind today and felt tempting ;)

I like it also but was afraid that it could break user code. 'in 
ref' is allowed since 2.060 and many users use 'in' because it is 
shorter than 'const' and feels like the opposite of 'out'. :/
Otherwise that would be a good idea. Let's hear what Kenji says.


More information about the Digitalmars-d mailing list