why @property cannot be pass as ref ?

ChangLong changlon at gmail.com
Wed Dec 20 15:02:11 UTC 2017


=======
struct A {
		alias This	= typeof(this) ;
		
		void opAssign(ref This ){
		}
		
		ref auto left(){
			return This() ;
		}
}

void main(){
	A	root ;
	ref find() {
	    auto p = root ;
	    p = p.left;
	}
}
===========

test.d(16): Error: function tree.A.opAssign (ref A _param_0) is 
not callable using argument types (A)


Is this by design ?



More information about the Digitalmars-d-learn mailing list