transporting qualifier from parameter to the return value
Andrei Alexandrescu
SeeWebsiteForEmail at erdani.org
Tue Dec 15 19:02:59 PST 2009
Time has come to make a decision on implementing Steven Schveighoffer's
proposal:
http://www.prowiki.org/wiki4d/wiki.cgi?LanguageDevel/DIPs/DIP2
It's been in the back of my mind for a while now, I don't find a fault
with it, it solves a very unpleasant problem that would seriously mar
qualifiers, and although it doesn't solve 100% of the potential cases,
it does solve a good fraction of them. I am confident that we can
require body duplication for the remaining stragglers with a straight face.
My main concern is allowing shared to participate to the inout
transportation. I am tempted to allow it, but shared is constrained much
more severely than the other two.
To avoid problems with the existing uses of inout (which is an old
synonym for ref), the language requires that you redundantly use inout
in the return type as well. We could eliminate that in D3.
Any thoughts would be appreciated.
Andrei
More information about the Digitalmars-d
mailing list